|
|
|
@ -2,14 +2,17 @@ package com.fr.design.mainframe.backgroundpane;
|
|
|
|
|
|
|
|
|
|
import com.fr.base.GraphHelper; |
|
|
|
|
import com.fr.base.background.PatternBackground; |
|
|
|
|
import com.fr.design.constants.UIConstants; |
|
|
|
|
import com.fr.design.border.UIRoundedBorder; |
|
|
|
|
import com.fr.design.constants.LayoutConstants; |
|
|
|
|
import com.fr.design.constants.UIConstants; |
|
|
|
|
import com.fr.design.event.UIObserverListener; |
|
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
|
|
import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
|
import com.fr.design.layout.TableLayout; |
|
|
|
|
import com.fr.design.layout.TableLayoutHelper; |
|
|
|
|
import com.fr.design.style.color.ColorSelectBox; |
|
|
|
|
import com.fr.general.Background; |
|
|
|
|
import com.fr.general.Inter; |
|
|
|
|
import com.fr.design.style.color.ColorSelectBox; |
|
|
|
|
|
|
|
|
|
import javax.swing.*; |
|
|
|
|
import javax.swing.event.ChangeEvent; |
|
|
|
@ -26,7 +29,7 @@ import java.awt.geom.Rectangle2D;
|
|
|
|
|
public class PatternBackgroundQuickPane extends BackgroundQuickPane { |
|
|
|
|
|
|
|
|
|
private int patternIndex = 0; // pattern setIndex.
|
|
|
|
|
private final static int DEFAULT_DIM_HEIGHT = 190; |
|
|
|
|
private final static int DEFAULT_DIM_HEIGHT = 210; |
|
|
|
|
private ColorSelectBox foregroundColorPane; |
|
|
|
|
private ColorSelectBox backgroundColorPane; |
|
|
|
|
private PatternButton[] patternButtonArray; |
|
|
|
@ -47,11 +50,20 @@ public class PatternBackgroundQuickPane extends BackgroundQuickPane {
|
|
|
|
|
patternButtonGroup.add(patternButtonArray[i]); |
|
|
|
|
typePane2.add(patternButtonArray[i]); |
|
|
|
|
} |
|
|
|
|
JPanel colorPane = new JPanel(new GridLayout(0, 2)); |
|
|
|
|
foregroundColorPane = new ColorSelectBox(70); |
|
|
|
|
backgroundColorPane = new ColorSelectBox(70); |
|
|
|
|
colorPane.add(this.createLabelColorPane(Inter.getLocText("FR-Designer_Foreground") + ":", foregroundColorPane)); |
|
|
|
|
colorPane.add(this.createLabelColorPane(Inter.getLocText("FR-Designer_Background") + ":", backgroundColorPane)); |
|
|
|
|
foregroundColorPane = new ColorSelectBox(60); |
|
|
|
|
backgroundColorPane = new ColorSelectBox(60); |
|
|
|
|
|
|
|
|
|
double f = TableLayout.FILL; |
|
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
|
new Component[]{null, null}, |
|
|
|
|
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Foreground"), UILabel.LEFT), foregroundColorPane}, |
|
|
|
|
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Background"), UILabel.LEFT), backgroundColorPane}, |
|
|
|
|
}; |
|
|
|
|
double[] rowSize = {p, p, p}; |
|
|
|
|
double[] columnSize = {p, f}; |
|
|
|
|
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}}; |
|
|
|
|
JPanel colorPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_LARGE); |
|
|
|
|
this.add(colorPane, BorderLayout.CENTER); |
|
|
|
|
foregroundColorPane.addSelectChangeListener(colorChangeListener); |
|
|
|
|
backgroundColorPane.addSelectChangeListener(colorChangeListener); |
|
|
|
@ -108,7 +120,7 @@ public class PatternBackgroundQuickPane extends BackgroundQuickPane {
|
|
|
|
|
listener.doChange(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
for (int i = 0, count = patternButtonArray.length; i < count; i ++) { |
|
|
|
|
for (int i = 0, count = patternButtonArray.length; i < count; i++) { |
|
|
|
|
patternButtonArray[i].addChangeListener(new ChangeListener() { |
|
|
|
|
public void stateChanged(ChangeEvent e) { |
|
|
|
|
listener.doChange(); |
|
|
|
|