|
|
@ -1,33 +1,25 @@ |
|
|
|
package com.fr.design.style.color; |
|
|
|
package com.fr.design.style.color; |
|
|
|
|
|
|
|
|
|
|
|
import java.awt.BorderLayout; |
|
|
|
|
|
|
|
import java.awt.Color; |
|
|
|
|
|
|
|
import java.awt.Cursor; |
|
|
|
|
|
|
|
import java.awt.Dimension; |
|
|
|
|
|
|
|
import java.awt.GridLayout; |
|
|
|
|
|
|
|
import java.awt.event.ActionEvent; |
|
|
|
|
|
|
|
import java.awt.event.ActionListener; |
|
|
|
|
|
|
|
import java.awt.event.MouseAdapter; |
|
|
|
|
|
|
|
import java.awt.event.MouseEvent; |
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import javax.swing.BorderFactory; |
|
|
|
|
|
|
|
import javax.swing.Box; |
|
|
|
|
|
|
|
import javax.swing.JPanel; |
|
|
|
|
|
|
|
import javax.swing.event.ChangeEvent; |
|
|
|
|
|
|
|
import javax.swing.event.ChangeListener; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.fr.design.constants.UIConstants; |
|
|
|
|
|
|
|
import com.fr.design.border.UIRoundedBorder; |
|
|
|
import com.fr.design.border.UIRoundedBorder; |
|
|
|
|
|
|
|
import com.fr.design.constants.UIConstants; |
|
|
|
|
|
|
|
import com.fr.design.dialog.BasicPane; |
|
|
|
import com.fr.design.gui.ibutton.UIButton; |
|
|
|
import com.fr.design.gui.ibutton.UIButton; |
|
|
|
import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
import com.fr.design.mainframe.DesignerContext; |
|
|
|
import com.fr.design.mainframe.DesignerContext; |
|
|
|
import com.fr.design.dialog.BasicPane; |
|
|
|
|
|
|
|
import com.fr.general.Inter; |
|
|
|
import com.fr.general.Inter; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import javax.swing.*; |
|
|
|
|
|
|
|
import javax.swing.event.ChangeEvent; |
|
|
|
|
|
|
|
import javax.swing.event.ChangeListener; |
|
|
|
|
|
|
|
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.util.ArrayList; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* |
|
|
|
|
|
|
|
* @author zhou |
|
|
|
* @author zhou |
|
|
|
* @since 2012-5-29上午10:39:35 |
|
|
|
* @since 2012-5-29上午10:39:35 |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -47,7 +39,7 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable { |
|
|
|
private final static int WINDWO_HEIGHT = 150; |
|
|
|
private final static int WINDWO_HEIGHT = 150; |
|
|
|
|
|
|
|
|
|
|
|
// 最近使用颜色
|
|
|
|
// 最近使用颜色
|
|
|
|
UsedColorPane usedColorPane; |
|
|
|
private UsedColorPane usedColorPane; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Constructor. |
|
|
|
* Constructor. |
|
|
@ -85,7 +77,7 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable { |
|
|
|
row1Pane.setPreferredSize(new Dimension(135, 16)); // 宽度为 16 * 8 + 7
|
|
|
|
row1Pane.setPreferredSize(new Dimension(135, 16)); // 宽度为 16 * 8 + 7
|
|
|
|
centerPane.add(row1Pane); |
|
|
|
centerPane.add(row1Pane); |
|
|
|
// 最近使用
|
|
|
|
// 最近使用
|
|
|
|
usedColorPane = new UsedColorPane(1, 8, 1, ColorSelectConfigManager.getInstance().getColors(), this, true, false); |
|
|
|
usedColorPane = new UsedColorPane(1, 8, 1, this, true, false); |
|
|
|
usedColorPane.getPane().setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 8)); |
|
|
|
usedColorPane.getPane().setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 8)); |
|
|
|
row1Pane.add(usedColorPane.getPane()); |
|
|
|
row1Pane.add(usedColorPane.getPane()); |
|
|
|
|
|
|
|
|
|
|
@ -102,7 +94,6 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable { |
|
|
|
|
|
|
|
|
|
|
|
// mod by anchore 16/11/16
|
|
|
|
// mod by anchore 16/11/16
|
|
|
|
UIButton customButton = new UIButton(Inter.getLocText("FR-Designer-Basic_More_Color")); |
|
|
|
UIButton customButton = new UIButton(Inter.getLocText("FR-Designer-Basic_More_Color")); |
|
|
|
//UIButton customButton = new UIButton(Inter.getLocText(new String[]{"More", "Color"}) + "...");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
customButton.addMouseListener(new MouseAdapter() { |
|
|
|
customButton.addMouseListener(new MouseAdapter() { |
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -118,11 +109,10 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 添加监听 |
|
|
|
* 添加监听 |
|
|
|
* @param 监听列表 |
|
|
|
* |
|
|
|
* Add change listener. |
|
|
|
* @param 监听列表 Add change listener. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void addChangeListener(ChangeListener changeListener) { |
|
|
|
public void addChangeListener(ChangeListener changeListener) { |
|
|
|
this.colorChangeListenerList.add(changeListener); |
|
|
|
this.colorChangeListenerList.add(changeListener); |
|
|
@ -135,6 +125,7 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 获取颜色 |
|
|
|
* 获取颜色 |
|
|
|
|
|
|
|
* |
|
|
|
* @return 颜色 |
|
|
|
* @return 颜色 |
|
|
|
* Return the color. |
|
|
|
* Return the color. |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -158,8 +149,7 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable { |
|
|
|
/** |
|
|
|
/** |
|
|
|
* Set the color. |
|
|
|
* Set the color. |
|
|
|
* |
|
|
|
* |
|
|
|
* @param color |
|
|
|
* @param color the new color. |
|
|
|
* the new color. |
|
|
|
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void setColor(Color color) { |
|
|
|
public void setColor(Color color) { |
|
|
@ -179,6 +169,7 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 设置颜色 |
|
|
|
* 设置颜色 |
|
|
|
|
|
|
|
* |
|
|
|
* @param 颜色位置 |
|
|
|
* @param 颜色位置 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -189,6 +180,7 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable { |
|
|
|
protected void doTransparent() { |
|
|
|
protected void doTransparent() { |
|
|
|
setColor(null); |
|
|
|
setColor(null); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected void customButtonPressed() { |
|
|
|
protected void customButtonPressed() { |
|
|
|
pane = new ColorSelectDetailPane(Color.WHITE); |
|
|
|
pane = new ColorSelectDetailPane(Color.WHITE); |
|
|
|
ColorSelectDialog.showDialog(DesignerContext.getDesignerFrame(), pane, Color.WHITE, this); |
|
|
|
ColorSelectDialog.showDialog(DesignerContext.getDesignerFrame(), pane, Color.WHITE, this); |
|
|
@ -204,12 +196,10 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 更新最近使用颜色 |
|
|
|
* 更新最近使用颜色 |
|
|
|
* |
|
|
|
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void updateUsedColor() { |
|
|
|
public void updateUsedColor() { |
|
|
|
usedColorPane.updateUsedColor(); |
|
|
|
usedColorPane.updateUsedColor(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |