Fixed Design bug in OACTabbedPane and functionality in OACTitleBar
This commit is contained in:
@@ -245,6 +245,12 @@ public class OACFrame extends JFrame {
|
||||
return (OACLayeredPane) super.getLayeredPane();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the resize cursor for the given edge / corner of this frame.
|
||||
* Required, since undecorated Frames cannot be resized by default
|
||||
* @param e event passed by mouse adapter
|
||||
* @return id of detected resize cursor
|
||||
*/
|
||||
private int getResizeCursor(MouseEvent e) {
|
||||
int x = e.getX();
|
||||
int y = e.getY();
|
||||
|
||||
@@ -22,6 +22,24 @@ public class OACTabbedPane extends JTabbedPane implements OACComponent {
|
||||
super(tabPlacement, tabLayoutPolicy);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTab(String title, Component component) {
|
||||
this.initOther(component);
|
||||
super.addTab(title, component);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTab(String title, Icon icon, Component component) {
|
||||
this.initOther(component);
|
||||
super.addTab(title, icon, component);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTab(String title, Icon icon, Component component, String tip) {
|
||||
this.initOther(component);
|
||||
super.addTab(title, icon, component, tip);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Component add(Component comp) {
|
||||
this.initOther(comp);
|
||||
|
||||
@@ -69,11 +69,10 @@ public class OACTitleBar extends OACPanel {
|
||||
* Adds a new tab.
|
||||
*
|
||||
* @param title tab title
|
||||
* @param panel tab body
|
||||
*/
|
||||
public void addTab(String title) {
|
||||
OACPanel placeholder = new OACPanel();
|
||||
placeholder.setOpaque(false);
|
||||
tabs.addTab(title, placeholder);
|
||||
public void addTab(String title, OACPanel panel) {
|
||||
tabs.addTab(title, panel);
|
||||
}
|
||||
|
||||
private OACTabbedPane createTabs() {
|
||||
|
||||
Reference in New Issue
Block a user