Browse Source

Merge remote-tracking branch 'origin/fbp/release' into fbp/release

fbp/merge
Destiny.Lin 3 months ago
parent
commit
3ad71eddbe
  1. 57
      designer-base/src/main/java/com/fr/design/constants/UIConstants.java
  2. 2
      designer-base/src/main/java/com/fr/design/gui/ibutton/UIPreviewButton.java
  3. 9
      designer-base/src/main/java/com/fr/design/gui/icontainer/UIEastResizableContainer.java
  4. 3
      designer-base/src/main/java/com/fr/design/gui/imenu/UICheckBoxMenuItem.java
  5. 30
      designer-base/src/main/java/com/fr/design/gui/itextfield/UISearchTextField.java
  6. 6
      designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/RecyclePane.java
  7. 47
      designer-chart/src/main/java/com/fr/design/chart/series/PlotSeries/UIGroupExtensionPane.java
  8. 8
      designer-chart/src/main/java/com/fr/van/chart/custom/component/ChartImageCheckOutPane.java

57
designer-base/src/main/java/com/fr/design/constants/UIConstants.java

@ -4,7 +4,6 @@
package com.fr.design.constants;
import com.fine.theme.icon.LazyIcon;
import com.fr.base.svg.IconUtils;
import com.fr.base.svg.SVGLoader;
import com.fr.general.IOUtils;
import com.fr.stable.Constants;
@ -27,7 +26,6 @@ import java.awt.image.BufferedImage;
*/
public interface UIConstants {
public static final Icon CPT_ICON = IOUtils.readIcon("/com/fr/base/images/oem/cpt.png");
public static final Icon BLACK_ICON = IOUtils.readIcon("/com/fr/base/images/cell/blank.gif");
public static final String EMPTY_ICON = StringUtils.EMPTY;
@ -153,67 +151,17 @@ public interface UIConstants {
public static final Color CHECK_BOX_TIP_FONT_COLOR = new Color(51, 51, 52, (int)Math.round(0.5 * 255));
public static final BufferedImage DRAG_BAR = IOUtils.readImage("com/fr/design/images/control/bar.png");
public static final BufferedImage DRAG_BAR_LIGHT = IOUtils.readImage("com/fr/design/images/control/bar-light.png");
public static final Image ARROW_NORTH = SVGLoader.load("/com/fr/design/standard/arrowlinear/up_arrow.svg");
public static final Image ARROW_SOUTH = SVGLoader.load("/com/fr/design/standard/arrowlinear/down_arrow.svg");
public static final Image ARROW_EAST = SVGLoader.load("/com/fr/design/standard/arrowlinear/east_arrow.svg");
public static final Image ARROW_WEST = SVGLoader.load("/com/fr/design/standard/arrowlinear/west_arrow.svg");
public static final BufferedImage DRAG_BAR_RIGHT = IOUtils.readImage("com/fr/design/images/control/barm.png");
public static final BufferedImage DRAG_BAR_LEFT = IOUtils.readImage("com/fr/design/images/control/barl.png");
public static final Image DRAG_UP_NORMAL = SVGLoader.load("/com/fr/design/standard/triangle.arrow/up_normal.svg");
public static final Image DRAG_UP_PRESS = SVGLoader.load("/com/fr/design/standard/triangle.arrow/up_hover.svg");
public static final Image DRAG_DOWN_NORMAL = SVGLoader.load("/com/fr/design/standard/triangle.arrow/down_normal.svg");
public static final Image DRAG_DOWN_PRESS = SVGLoader.load("/com/fr/design/standard/triangle.arrow/down_hover.svg");
public static final Image DRAG_RIGHT_NORMAL = SVGLoader.load("/com/fr/design/standard/drag/right_normal.svg");
public static final Image DRAG_RIGHT_PRESS = SVGLoader.load("/com/fr/design/standard/drag/right_pressed.svg");
public static final Image DRAG_LEFT_NORMAL = SVGLoader.load("/com/fr/design/standard/drag/left_normal.svg");
public static final Image DRAG_LEFT_PRESS = SVGLoader.load("/com/fr/design/standard/drag/left_pressed.svg");
public static final BufferedImage DRAG_DOT = IOUtils.readImage("com/fr/design/images/control/dot.png");
public static final Image DRAG_LINE = SVGLoader.load("/com/fr/design/standard/dot_line_normal.svg");
public static final BufferedImage ACCESSIBLE_EDITOR_DOT = IOUtils.readImage("com/fr/design/images/control/dot.png");
public static final BufferedImage DRAG_DOT_VERTICAL = IOUtils.readImage("com/fr/design/images/control/dotv.png");
public static final Image POP_BUTTON_DOWN = SVGLoader.load("/com/fr/design/standard/poparrow/pop_down_arrow.svg");
public static final Image POP_BUTTON_UP = SVGLoader.load("/com/fr/design/standard/poparrow/pop_up_arrow.svg");
public static final BufferedImage DRAG_DOWN_SELECTED_SMALL = IOUtils.readImage("com/fr/design/images/buttonicon/downSelected.png");
public static final BufferedImage DRAG_LEFT_NORMAL_SMALL = IOUtils.readImage("com/fr/design/images/buttonicon/leftNormal.png");
public static final BufferedImage WATERMARK_BACKGROUND = IOUtils.readImage("/com/fr/design/images/dialog/watermark/" + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_WaterMark_Background_Icon_File_Name"));
public static final int MODEL_NORMAL = 0;
public static final int MODEL_PRESS = 1;
public static final Icon ARROW_DOWN_ICON = IconUtils.readIcon("/com/fr/design/standard/arrowlinear/down_arrow.svg");
public static final Icon ARROW_UP_ICON = IOUtils.readIcon("com/fr/design/images/buttonicon/arrowup.png");
public static final Icon YES_ICON = IOUtils.readIcon("com/fr/design/images/buttonicon/yes.png");
public static final Icon CHOOSEN_ICON = IOUtils.readIcon("com/fr/design/images/buttonicon/select_item.png");
public static final Icon PRE_WIDGET_ICON = IOUtils.readIcon("com/fr/design/images/buttonicon/prewidget.png");
public static final Icon PRE_WIDGET_NORMAL_ICON = IconUtils.readIcon("com/fr/design/images/buttonicon/prewidget");
public static final Icon EDIT_NORMAL_ICON = IconUtils.readIcon("/com/fr/design/standard/uimode/edit");
public static final Icon EDIT_PRESSED_ICON = IconUtils.readIcon("/com/fr/design/standard/uimode/edit_pressed.svg");
public static final Icon HIDE_NORMAL_ICON = IconUtils.readIcon("/com/fr/design/standard/uimode/hide");
public static final Icon HIDE_PRESSED_ICON = IconUtils.readIcon("/com/fr/design/standard/uimode/hide_pressed.svg");
public static final Icon VIEW_NORMAL_ICON = IconUtils.readIcon("/com/fr/design/standard/uimode/view");
//public static final Icon VIEW_PRESSED_ICON = IconUtils.readIcon("/com/fr/design/standard/uimode/view");
public static final Icon RUN_BIG_ICON = IconUtils.readIcon("/com/fr/design/standard/preview/run24.svg");
public static final Icon RUN_SMALL_ICON = IconUtils.readIcon("/com/fr/design/standard/preview/runs.svg");
public static final Icon PAGE_BIG_ICON = IconUtils.readIcon("/com/fr/design/standard/preview/pageb24.svg");
public static final Icon WRITE_BIG_ICON = IconUtils.readIcon("/com/fr/design/standard/preview/writeb24.svg");
public static final Icon ANA_BIG_ICON = IconUtils.readIcon("/com/fr/design/standard/preview/anab24.svg");
public static final Icon PAGE_SMALL_ICON = IconUtils.readIcon("/com/fr/design/standard/preview/pages.svg");
public static final Icon WRITE_SMALL_ICON = IconUtils.readIcon("/com/fr/design/standard/preview/writes.svg");
public static final Icon ANA_SMALL_ICON = IconUtils.readIcon("/com/fr/design/standard/preview/anas.svg");
public static final Icon REFRESH_ICON = IOUtils.readIcon("com/fr/design/images/buttonicon/refresh.png");
public static final Icon FONT_ICON = IOUtils.readIcon("/com/fr/design/images/gui/color/foreground.png");
public static final Icon AUTO_FONT_ICON = IOUtils.readIcon("/com/fr/design/images/gui/color/autoForeground.png");
public static final Icon HISTORY_ICON = IOUtils.readIcon("com/fr/design/images/buttonicon/history.png");
public static final Icon DELETE_ICON = IOUtils.readIcon("com/fr/design/images/m_file/close.png");
public static final Icon EDIT_ICON = IOUtils.readIcon("com/fr/design/images/m_file/edit.png");
public static final Icon SEARCH_ICON = IOUtils.readIcon("/com/fr/design/images/data/search.png");
public static final Icon BLACK_SEARCH_ICON = IOUtils.readIcon("/com/fr/design/images/data/black_search.png");
public static final Icon CLEAR_ICON = IOUtils.readIcon("/com/fr/design/images/data/source/delete.png");
public static final Icon LIST_EDIT_ICON = IOUtils.readIcon("/com/fr/design/images/control/edit.png");
public static final Icon LIST_EDIT_WHITE_ICON = IOUtils.readIcon("/com/fr/design/images/control/edit_white.png");
public static final Icon ARROW_DOWN_ICON = new LazyIcon("down_arrow");
public static final Icon ARROW_UP_ICON = new LazyIcon("up_arrow");
public static final Color PRESSED_DARK_GRAY = new Color(127, 127, 127);
public static final Color GRDIENT_DARK_GRAY = new Color(45, 45, 45);
public static final Color BARNOMAL = new Color(232, 232, 233);
@ -222,7 +170,6 @@ public interface UIConstants {
public static final int BUTTON_GROUP_ARC = 0;
public static final int LARGEARC = 6;
public static final Stroke BS = new BasicStroke(1f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND, 2f, new float[]{3, 1}, 0);
public static final Icon PREVIEW_DOWN = IconUtils.readIcon("/com/fr/design/standard/preview_down_icon");
public static final int CLOSE_AUTHORITY_HEIGHT_AND_WIDTH = 24;
public static final Icon CLOSE_OF_AUTHORITY = new LazyIcon("platform_close", CLOSE_AUTHORITY_HEIGHT_AND_WIDTH).disabled();
public static final Icon CLOSE_OVER_AUTHORITY = new LazyIcon("platform_close", CLOSE_AUTHORITY_HEIGHT_AND_WIDTH);

2
designer-base/src/main/java/com/fr/design/gui/ibutton/UIPreviewButton.java

@ -1 +1 @@
package com.fr.design.gui.ibutton; import com.fr.design.constants.UIConstants; import com.fr.stable.Constants; import com.fr.design.utils.gui.GUICoreUtils; import javax.swing.*; import java.awt.*; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; /** * Author : daisy * Date: 13-8-1 * Time: 下午3:41 */ public class UIPreviewButton extends JPanel { private static final int START_X = -7; protected UIButton upButton; protected UIButton downButton; protected void upButtonClickEvent() { // do nothing } protected void downButtonClickEvent() { // do nothing } public UIPreviewButton() { this(new UIButton(), new UIButton()); } public UIPreviewButton(UIButton up, UIButton down) { upButton = up; downButton = down; upButton.setRoundBorder(true, Constants.CENTER); downButton.setRoundBorder(true, Constants.CENTER); upButton.addMouseListener(new MouseAdapter() { @Override public void mousePressed(MouseEvent e) { downButton.getModel().setPressed(true); downButton.getModel().setSelected(true); downButton.repaint(); } @Override public void mouseReleased(MouseEvent e) { downButton.getModel().setPressed(false); downButton.getModel().setSelected(false); downButton.repaint(); } @Override public void mouseClicked(MouseEvent e) { upButtonClickEvent(); } }); downButton.addMouseListener(new MouseAdapter() { @Override public void mousePressed(MouseEvent e) { upButton.getModel().setPressed(true); upButton.getModel().setSelected(true); upButton.repaint(); } @Override public void mouseReleased(MouseEvent e) { upButton.getModel().setPressed(false); upButton.getModel().setSelected(false); upButton.repaint(); } @Override public void mouseClicked(MouseEvent e) { downButtonClickEvent(); } }); this.setLayout(new FlowLayout(FlowLayout.CENTER,5,0)); this.add(upButton); this.add(downButton); } public UIPreviewButton(Icon left, Icon right) { this(); upButton.setIcon(left); downButton.setIcon(right); } public UIButton getUpButton() { return upButton; } public void setExtraPainted(boolean isExtraPainted) { if (!isExtraPainted) { upButton.setBackground(null); downButton.setBackground(null); upButton.setOpaque(false); downButton.setOpaque(false); } } public UIButton getDownButton() { return downButton; } public void set4Toolbar() { upButton.setNormalPainted(false); downButton.setNormalPainted(false); upButton.setBorderPaintedOnlyWhenPressed(true); downButton.setBorderPaintedOnlyWhenPressed(true); } protected void showPopWindow(JPopupMenu menu) { GUICoreUtils.showPopupMenu(menu, this, START_X, getY() + getHeight() - 3); } public static void main(String... args) { JFrame jf = new JFrame("test"); jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JPanel content = (JPanel) jf.getContentPane(); content.setLayout(null); UIPreviewButton bb = new UIPreviewButton(UIConstants.PAGE_BIG_ICON, UIConstants.PREVIEW_DOWN); bb.setBounds(20, 20, bb.getPreferredSize().width, bb.getPreferredSize().height); content.add(bb); GUICoreUtils.centerWindow(jf); jf.setSize(100, 100); jf.setVisible(true); } }
package com.fr.design.gui.ibutton; import com.fr.design.constants.UIConstants; import com.fr.stable.Constants; import com.fr.design.utils.gui.GUICoreUtils; import javax.swing.*; import java.awt.*; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; /** * Author : daisy * Date: 13-8-1 * Time: 下午3:41 */ public class UIPreviewButton extends JPanel { private static final int START_X = -7; protected UIButton upButton; protected UIButton downButton; protected void upButtonClickEvent() { // do nothing } protected void downButtonClickEvent() { // do nothing } public UIPreviewButton() { this(new UIButton(), new UIButton()); } public UIPreviewButton(UIButton up, UIButton down) { upButton = up; downButton = down; upButton.setRoundBorder(true, Constants.CENTER); downButton.setRoundBorder(true, Constants.CENTER); upButton.addMouseListener(new MouseAdapter() { @Override public void mousePressed(MouseEvent e) { downButton.getModel().setPressed(true); downButton.getModel().setSelected(true); downButton.repaint(); } @Override public void mouseReleased(MouseEvent e) { downButton.getModel().setPressed(false); downButton.getModel().setSelected(false); downButton.repaint(); } @Override public void mouseClicked(MouseEvent e) { upButtonClickEvent(); } }); downButton.addMouseListener(new MouseAdapter() { @Override public void mousePressed(MouseEvent e) { upButton.getModel().setPressed(true); upButton.getModel().setSelected(true); upButton.repaint(); } @Override public void mouseReleased(MouseEvent e) { upButton.getModel().setPressed(false); upButton.getModel().setSelected(false); upButton.repaint(); } @Override public void mouseClicked(MouseEvent e) { downButtonClickEvent(); } }); this.setLayout(new FlowLayout(FlowLayout.CENTER,5,0)); this.add(upButton); this.add(downButton); } public UIPreviewButton(Icon left, Icon right) { this(); upButton.setIcon(left); downButton.setIcon(right); } public UIButton getUpButton() { return upButton; } public void setExtraPainted(boolean isExtraPainted) { if (!isExtraPainted) { upButton.setBackground(null); downButton.setBackground(null); upButton.setOpaque(false); downButton.setOpaque(false); } } public UIButton getDownButton() { return downButton; } public void set4Toolbar() { upButton.setNormalPainted(false); downButton.setNormalPainted(false); upButton.setBorderPaintedOnlyWhenPressed(true); downButton.setBorderPaintedOnlyWhenPressed(true); } protected void showPopWindow(JPopupMenu menu) { GUICoreUtils.showPopupMenu(menu, this, START_X, getY() + getHeight() - 3); } }

9
designer-base/src/main/java/com/fr/design/gui/icontainer/UIEastResizableContainer.java

@ -54,6 +54,7 @@ public class UIEastResizableContainer extends JPanel {
private static final int DRAG_GAP_SIZE = 10;
private Point dragPoint;
private boolean dragging;
public UIEastResizableContainer() {
this(new JPanel(), new JPanel());
@ -71,13 +72,21 @@ public class UIEastResizableContainer extends JPanel {
public void mousePressed(MouseEvent e) {
if (isEnableDrag(e)) {
dragPoint = e.getPoint();
dragging = true;
}
}
@Override
public void mouseDragged(MouseEvent e) {
if (dragging) {
resizePanel(e);
}
}
@Override
public void mouseReleased(MouseEvent e) {
dragging = false;
}
};
addMouseListener(mouseAdapter);

3
designer-base/src/main/java/com/fr/design/gui/imenu/UICheckBoxMenuItem.java

@ -1,5 +1,6 @@
package com.fr.design.gui.imenu;
import com.fine.theme.icon.LazyIcon;
import com.fr.design.constants.UIConstants;
public class UICheckBoxMenuItem extends UIMenuItem {
@ -19,7 +20,7 @@ public class UICheckBoxMenuItem extends UIMenuItem {
public void setSelected(boolean b) {
super.setSelected(b);
if (this.isSelected()) {
setIcon(UIConstants.CHOOSEN_ICON);
setIcon(new LazyIcon("checkbox_checked"));
} else {
setIcon(UIConstants.BLACK_ICON);
}

30
designer-base/src/main/java/com/fr/design/gui/itextfield/UISearchTextField.java

@ -1,6 +1,7 @@
package com.fr.design.gui.itextfield;
import com.fine.theme.icon.LazyIcon;
import com.fr.design.constants.UIConstants;
import com.fr.design.gui.ilable.UILabel;
@ -25,8 +26,8 @@ import java.awt.geom.RoundRectangle2D;
*/
public class UISearchTextField extends UITextField {
private UILabel iconLabel = new UILabel(UIConstants.BLACK_SEARCH_ICON);
private UILabel clearLabel = new UILabel(UIConstants.CLEAR_ICON);
private UILabel iconLabel = new UILabel(new LazyIcon("search"));
private UILabel clearLabel = new UILabel(new LazyIcon("clear"));
private UILabel infoLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Search"));
private Dimension iconSize;
private Dimension infoSize;
@ -268,29 +269,4 @@ public class UISearchTextField extends UITextField {
this.showClearIcon = showClearIcon;
this.repaint();
}
public static void main(String[] args) {
JPanel p = new JPanel(new FlowLayout(FlowLayout.LEFT));
UISearchTextField comp = new UISearchTextField(20);
p.add(comp);
comp = new UISearchTextField(20);
comp.setShowClearIcon(false);
p.add(comp);
comp = new UISearchTextField(20);
comp.setIconPosition(SwingConstants.RIGHT);
p.add(comp);
comp = new UISearchTextField(20);
comp.setShowClearIcon(false);
comp.setIconPosition(SwingConstants.RIGHT);
p.add(comp);
p.add(new JTextField(20));
JFrame frame = new JFrame();
frame.setTitle("UITextField");
frame.setContentPane(p);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(300, 200);
frame.setLocationRelativeTo(null);
frame.setVisible(true);
}
}

6
designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/RecyclePane.java

@ -2,9 +2,9 @@ package com.fr.design.mainframe.vcs.ui;
import com.fine.theme.icon.LazyIcon;
import com.fine.theme.light.ui.FineRoundBorder;
import com.fine.theme.utils.FineUIScale;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.svg.IconUtils;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.gui.ilable.UILabel;
@ -121,11 +121,11 @@ public class RecyclePane extends AbstractSupportSelectTablePane<VcsTableEntity>
if (isNeedSearch()) {
searchTextField = new UITextField();
searchTextField.setPlaceholder(Toolkit.i18nText("Fine-Design_Vcs_Start_Search"));
searchTextField.setColumns(COLUMNS_COUNT);
searchTextField.setPreferredSize(new Dimension(FineUIScale.scale(150), super.getPreferredSize().height));
UILabel searchLabel = new UILabel(ICON_SEARCH);
searchLabel.setBorder(new ScaledEmptyBorder(0, 4, 0, 4));
searchTextField.setBorder(null);
leftPane = row(cell(searchLabel), cell(searchTextField).weight(1)).with(it -> {
leftPane = row(cell(searchLabel), cell(searchTextField)).with(it -> {
it.setBorder(new FineRoundBorder());
it.setOpaque(true);
it.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE));

47
designer-chart/src/main/java/com/fr/design/chart/series/PlotSeries/UIGroupExtensionPane.java

@ -1,15 +1,14 @@
package com.fr.design.chart.series.PlotSeries;
import com.fine.theme.icon.LazyIcon;
import com.fr.chart.base.MapSvgXMLHelper;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.constants.UIConstants;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.dialog.UIDialog;
import com.fr.design.event.ChangeEvent;
import com.fr.design.event.ChangeListener;
import com.fr.design.gui.frpane.UIExtensionPane;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.ilable.BoldFontTextLabel;
import com.fr.design.gui.ilable.UILabel;
@ -33,8 +32,6 @@ import javax.swing.event.ListDataListener;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
@ -50,8 +47,6 @@ import java.util.List;
* 可收缩的面板只有两层
*/
public class UIGroupExtensionPane extends BasicPane {
public static final String EDIT = "edit";
public static final String DELETE = "delete";
private static final int BUTTONWIDTH = 16;
private static final int DIALOG_WIDTH = 140;
private static final int DIALOG_HEIGHT = 100;
@ -350,8 +345,8 @@ public class UIGroupExtensionPane extends BasicPane {
JComponent c = (JComponent) super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
Border border = null;
c.setBorder(border);
UILabel editLabel = new UILabel(UIConstants.EDIT_ICON);
UILabel deleteLabel = new UILabel(UIConstants.DELETE_ICON);
UILabel editLabel = new UILabel(new LazyIcon("edit"));
UILabel deleteLabel = new UILabel(new LazyIcon("remove"));
JPanel editPane = GUICoreUtils.createFlowPane(new Component[]{editLabel, deleteLabel}, FlowLayout.LEFT, LayoutConstants.HGAP_LARGE);
editPane.setBackground(isSelected ? c.getBackground() : null);
@ -548,40 +543,4 @@ public class UIGroupExtensionPane extends BasicPane {
}
}
}
/**
* 测试程序
* @param args 参数
*/
public static void main(String[] args) {
JFrame f = new JFrame();
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Container c = f.getContentPane();
c.setBackground(Color.WHITE);
c.setLayout(new BoxLayout(c, BoxLayout.Y_AXIS));
final UIGroupExtensionPane g = new UIGroupExtensionPane(new String[]{"title1", "title2", "title3"});
c.add(g, BorderLayout.CENTER);
JPanel pp = new JPanel(new FlowLayout());
c.add(pp, BorderLayout.SOUTH);
UIButton test = new UIButton("add1");
test.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
g.addData("test111", 0);
}
});
pp.add(test);
UIButton test2 = new UIButton("add2");
test2.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
g.addData("test222", 1);
}
});
pp.add(test2);
f.setSize(360, 500);
f.setLocation(200, 100);
f.setVisible(true);
}
}

8
designer-chart/src/main/java/com/fr/van/chart/custom/component/ChartImageCheckOutPane.java

@ -33,6 +33,7 @@ public class ChartImageCheckOutPane extends BasicPane implements UIObserver {
private static final int ICON_WIDTH = 56;
private static final int ICON_HEIGHT = 50;
private final ArrayList<ChangeListener> changeListeners = new ArrayList<ChangeListener>();
private static final String CHART_ICON_PREFIX = "icon_";
public ChartImageCheckOutPane(CustomPlotType type){
this(type, false);
@ -66,8 +67,13 @@ public class ChartImageCheckOutPane extends BasicPane implements UIObserver {
this.add(row(flex(), cell(checkBox)).getComponent(), BorderLayout.NORTH);
}
/**
* 图表iconId注册时设置为"icon_" + 图表类型
* @param customPlotType
* @return
*/
private String getIconId(CustomPlotType customPlotType) {
return CustomPlotFactory.getTypeIconId(customPlotType);
return CHART_ICON_PREFIX + customPlotType.getType();
}
public JCheckBox getCheckBox() {

Loading…
Cancel
Save