Browse Source

REPORT-3163 合作开发9.0设计器=>使用UIButton作为竖向tab的按钮

master
plough 7 years ago
parent
commit
d6d632aedc
  1. 12
      designer_base/src/com/fr/design/gui/icontainer/UIEastResizableContainer.java
  2. 33
      designer_base/src/com/fr/design/mainframe/EastRegionContainerPane.java

12
designer_base/src/com/fr/design/gui/icontainer/UIEastResizableContainer.java

@ -33,7 +33,7 @@ public class UIEastResizableContainer extends JPanel {
private static final int ARROW_MARGIN = 15;
private static final int ARROW_RANGE = 35;
private boolean isRightPaneVisible = true;
// private boolean isRightPaneVisible = true;
public UIEastResizableContainer() {
this(new JPanel(), new JPanel());
@ -49,11 +49,15 @@ public class UIEastResizableContainer extends JPanel {
this.preferredWidth = width;
}
public void setRightPaneVisible(boolean isVisible){
this.isRightPaneVisible = isVisible;
public boolean isRightPaneVisible() {
return containerWidth > leftPaneWidth;
}
// public void setRightPaneVisible(boolean isVisible){
// this.isRightPaneVisible = isVisible;
// }
private void setPreferredWidth(int width) {
this.preferredWidth = width;
}

33
designer_base/src/com/fr/design/mainframe/EastRegionContainerPane.java

@ -5,6 +5,7 @@ import com.fr.design.DesignerEnvManager;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icontainer.UIEastResizableContainer;
import com.fr.design.gui.icontainer.UIResizableContainer;
import com.fr.design.layout.VerticalFlowLayout;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.stable.Constants;
@ -90,6 +91,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
// 左侧按钮面板
private void initLeftPane() {
leftPane = new JPanel();
leftPane.setLayout(new VerticalFlowLayout(VerticalFlowLayout.TOP, 0, 0));
for (PropertyItem item : propertyItemList) {
leftPane.add(item.getButton());
}
@ -186,7 +188,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
class PropertyItem {
// private UIButton button;
private JButton button;
private UIButton button;
private String name;
private JPanel propertyPanel;
private JComponent contentPane;
@ -243,20 +245,33 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
}
private void initButton(String btnUrl) {
button = new JButton(BaseUtils.readIcon(btnUrl));
button = new UIButton(BaseUtils.readIcon(btnUrl)) {
public Dimension getPreferredSize() {
return new Dimension(BUTTON_WIDTH, BUTTON_WIDTH);
}
};
// button = new UIButton("btnd\nssdg");
// button.set4LargeToolbarButton();
button.setPreferredSize(new Dimension(BUTTON_WIDTH, BUTTON_WIDTH));
button.setContentAreaFilled(false);
// button.setBorder(BorderFactory.createEmptyBorder(0, 40, 0, 0));
// button.setMargin(null);
// button.setOpaque(false);
button.set4LargeToolbarButton();
// button.setSize(new Dimension(BUTTON_WIDTH, BUTTON_WIDTH));
// button.setPreferredSize(new Dimension(BUTTON_WIDTH, BUTTON_WIDTH));
// button.setContentAreaFilled(false);
button.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
propertyCard.show(rightPane, name);
if (isRightPaneVisible()) {
propertyCard.show(rightPane, name);
} else {
popOut();
}
}
});
}
public JButton getButton() {
public UIButton getButton() {
return button;
}
@ -267,5 +282,11 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
public JPanel getPropertyPanel() {
return propertyPanel;
}
// 弹出对话框
public void popOut() {
JDialog dialog = new JDialog();
dialog.setVisible(true);
}
}
}
Loading…
Cancel
Save