|
|
|
@ -19,6 +19,7 @@ import com.fr.design.style.color.ColorControlWindow;
|
|
|
|
|
import com.fr.design.style.color.ColorSelectBox; |
|
|
|
|
import com.fr.design.utils.gui.GUICoreUtils; |
|
|
|
|
import com.fr.general.Inter; |
|
|
|
|
import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; |
|
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
|
|
|
|
|
|
import javax.swing.*; |
|
|
|
@ -32,11 +33,14 @@ import java.util.List;
|
|
|
|
|
|
|
|
|
|
public class UIColorPickerPane extends BasicPane implements UIObserver { |
|
|
|
|
private static final int MARGIN_TOP = 10; |
|
|
|
|
private static final int MARGIN_LEFT = 5; |
|
|
|
|
private static final int COLORGROUP_MARGIN_LEFT = 40; |
|
|
|
|
private static final int OFF_HEIGHT = 6; |
|
|
|
|
private static final int COLOR_REC_HEIGHT = 40; |
|
|
|
|
private static final int COLOR_REC_WIDTH = 30; |
|
|
|
|
protected static final int TEXTFIELD_HEIGHT = 20; |
|
|
|
|
protected static final int TEXTFIELD_WIDTH = 120; |
|
|
|
|
protected static final int UPCONTROLPANE_WIDTH = 230; |
|
|
|
|
private static final int LAYOUR_DET = 6; |
|
|
|
|
private static final double VALUE = 100; |
|
|
|
|
|
|
|
|
@ -182,17 +186,18 @@ public class UIColorPickerPane extends BasicPane implements UIObserver {
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
|
double f = TableLayout.FILL; |
|
|
|
|
double[] columnSize = {p, f}; |
|
|
|
|
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; |
|
|
|
|
double d = TableLayout4VanChartHelper.DESCRIPTION_AREA_WIDTH; |
|
|
|
|
double[] columnSize = {d, e}; |
|
|
|
|
double[] rowSize = {p}; |
|
|
|
|
Component[][] tmpComp = new Component[][]{new Component[]{new BoldFontTextLabel(Inter.getLocText("FR-Chart-Value_Divided_stage")), regionNumPane}}; |
|
|
|
|
|
|
|
|
|
stagePanel = TableLayoutHelper.createTableLayoutPane(tmpComp, rowSize, columnSize); |
|
|
|
|
stagePanel = TableLayout4VanChartHelper.createGapTableLayoutPane(tmpComp, rowSize, columnSize); |
|
|
|
|
|
|
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
|
new Component[]{new BoldFontTextLabel(Inter.getLocText("FR-Chart-Value_Tick_And_Color")), designTypeButtonGroup}, |
|
|
|
|
}; |
|
|
|
|
upControlPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); |
|
|
|
|
upControlPane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize); |
|
|
|
|
|
|
|
|
|
this.textGroup = new TextFieldGroupPane(); |
|
|
|
|
this.colorGroup = new ColorGroupPane(); |
|
|
|
@ -249,7 +254,7 @@ public class UIColorPickerPane extends BasicPane implements UIObserver {
|
|
|
|
|
*/ |
|
|
|
|
public Dimension getPreferredSize() { |
|
|
|
|
if (designTypeButtonGroup.getSelectedIndex() == 0) { |
|
|
|
|
return new Dimension(colorGroup.getPreferredSize().width + textGroup.getPreferredSize().width, upControlPane.getPreferredSize().height); |
|
|
|
|
return new Dimension(colorGroup.getPreferredSize().width + textGroup.getPreferredSize().width, upControlPane.getPreferredSize().height + MARGIN_TOP); |
|
|
|
|
} else { |
|
|
|
|
int extra = stagePanel == null ? 0 : stagePanel.getPreferredSize().height + this.MARGIN_TOP; |
|
|
|
|
return new Dimension(colorGroup.getPreferredSize().width + textGroup.getPreferredSize().width, |
|
|
|
@ -573,10 +578,10 @@ public class UIColorPickerPane extends BasicPane implements UIObserver {
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void layoutContainer(Container parent) { |
|
|
|
|
upControlPane.setBounds(0, 0, parent.getPreferredSize().width, upControlPane.getPreferredSize().height); |
|
|
|
|
stagePanel.setBounds(0,upControlPane.getPreferredSize().height + LAYOUR_DET, parent.getPreferredSize().width, stagePanel.getPreferredSize().height); |
|
|
|
|
colorGroup.setBounds(0, MARGIN_TOP + upControlPane.getPreferredSize().height + stagePanel.getPreferredSize().height + 2 * LAYOUR_DET, colorGroup.getPreferredSize().width, colorGroup.getPreferredSize().height + upControlPane.getPreferredSize().height); |
|
|
|
|
textGroup.setBounds(colorGroup.getPreferredSize().width, upControlPane.getPreferredSize().height+ stagePanel.getPreferredSize().height + 2 * LAYOUR_DET, textGroup.getPreferredSize().width, textGroup.getPreferredSize().height); |
|
|
|
|
upControlPane.setBounds(MARGIN_LEFT, MARGIN_TOP, UPCONTROLPANE_WIDTH, upControlPane.getPreferredSize().height + MARGIN_TOP); |
|
|
|
|
stagePanel.setBounds(MARGIN_LEFT, upControlPane.getPreferredSize().height + LAYOUR_DET + MARGIN_TOP, UPCONTROLPANE_WIDTH, stagePanel.getPreferredSize().height); |
|
|
|
|
colorGroup.setBounds(COLORGROUP_MARGIN_LEFT, 2 * MARGIN_TOP + upControlPane.getPreferredSize().height + stagePanel.getPreferredSize().height + 2 * LAYOUR_DET, colorGroup.getPreferredSize().width, colorGroup.getPreferredSize().height + upControlPane.getPreferredSize().height); |
|
|
|
|
textGroup.setBounds(colorGroup.getPreferredSize().width + COLORGROUP_MARGIN_LEFT, upControlPane.getPreferredSize().height + stagePanel.getPreferredSize().height + 2 * LAYOUR_DET + MARGIN_TOP, textGroup.getPreferredSize().width, textGroup.getPreferredSize().height); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@ -603,9 +608,9 @@ public class UIColorPickerPane extends BasicPane implements UIObserver {
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void layoutContainer(Container parent) { |
|
|
|
|
upControlPane.setBounds(0, 0, parent.getPreferredSize().width, upControlPane.getPreferredSize().height); |
|
|
|
|
colorGroup.setBounds(0, MARGIN_TOP + upControlPane.getPreferredSize().height + LAYOUR_DET, colorGroup.getPreferredSize().width, colorGroup.getPreferredSize().height + upControlPane.getPreferredSize().height); |
|
|
|
|
textGroup.setBounds(colorGroup.getPreferredSize().width, upControlPane.getPreferredSize().height + LAYOUR_DET, textGroup.getPreferredSize().width, textGroup.getPreferredSize().height); |
|
|
|
|
upControlPane.setBounds(MARGIN_LEFT, MARGIN_TOP, UPCONTROLPANE_WIDTH, upControlPane.getPreferredSize().height); |
|
|
|
|
colorGroup.setBounds(COLORGROUP_MARGIN_LEFT, MARGIN_TOP + upControlPane.getPreferredSize().height + LAYOUR_DET, colorGroup.getPreferredSize().width, colorGroup.getPreferredSize().height + upControlPane.getPreferredSize().height); |
|
|
|
|
textGroup.setBounds(colorGroup.getPreferredSize().width + COLORGROUP_MARGIN_LEFT, upControlPane.getPreferredSize().height + LAYOUR_DET, textGroup.getPreferredSize().width, textGroup.getPreferredSize().height); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|