Browse Source
Merge in DESIGN/design from ~KERRY/design_10.0:feature/x to feature/x * commit 'e08a30471164eeb45871a4a07b4e2b9cc033023b': 代码修改 REPORT-58225【主题切换】除图表外所有渐变色设置,打开颜色控件显示不正确research/11.0
kerry
3 years ago
7 changed files with 75 additions and 83 deletions
@ -0,0 +1,39 @@ |
|||||||
|
package com.fr.design.style.background.gradient; |
||||||
|
|
||||||
|
import com.fr.design.DesignerEnvManager; |
||||||
|
import com.fr.design.mainframe.DesignerContext; |
||||||
|
import com.fr.design.style.color.ColorSelectDetailPane; |
||||||
|
import com.fr.design.style.color.ColorSelectDialog; |
||||||
|
|
||||||
|
import javax.swing.JPanel; |
||||||
|
import java.awt.Color; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author Bjorn |
||||||
|
* @version 10.0 |
||||||
|
* Created by Bjorn on 2021-08-19 |
||||||
|
*/ |
||||||
|
public class FixedGradientBarNoTheme extends FixedGradientBar { |
||||||
|
|
||||||
|
|
||||||
|
public FixedGradientBarNoTheme(int minvalue, int maxvalue) { |
||||||
|
super(minvalue, maxvalue); |
||||||
|
} |
||||||
|
|
||||||
|
protected void clickButton(int select) { |
||||||
|
ColorSelectDetailPane pane = new ColorSelectDetailPane(Color.WHITE); |
||||||
|
Color selectColor = getList().get(select).getColorInner() == null ? Color.WHITE : getList().get(select).getColorInner(); |
||||||
|
ColorSelectDialog.showDialog(DesignerContext.getDesignerFrame(), pane, selectColor, FixedGradientBarNoTheme.this); |
||||||
|
Color color = FixedGradientBarNoTheme.this.getColor(); |
||||||
|
if (color != null) { |
||||||
|
DesignerEnvManager.getEnvManager().getColorConfigManager().addToColorQueue(color); |
||||||
|
getList().get(select).setColorInner(color); |
||||||
|
stateChanged(); |
||||||
|
FixedGradientBarNoTheme.this.repaint(); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
public JPanel initWindowPane(double preWidth) { |
||||||
|
return null; |
||||||
|
} |
||||||
|
} |
@ -1,53 +0,0 @@ |
|||||||
package com.fr.design.style.background.gradient; |
|
||||||
|
|
||||||
import com.fr.base.background.ColorBackground; |
|
||||||
import com.fr.design.style.color.NewColorSelectPane; |
|
||||||
|
|
||||||
import javax.swing.JPanel; |
|
||||||
import javax.swing.event.ChangeEvent; |
|
||||||
import javax.swing.event.ChangeListener; |
|
||||||
|
|
||||||
/** |
|
||||||
* @author Bjorn |
|
||||||
* @version 10.0 |
|
||||||
* Created by Bjorn on 2021-08-19 |
|
||||||
*/ |
|
||||||
public class FixedGradientBarWithPopMenu extends FixedGradientBar { |
|
||||||
|
|
||||||
private NewColorSelectPane colorPane; |
|
||||||
|
|
||||||
public FixedGradientBarWithPopMenu(int minvalue, int maxvalue) { |
|
||||||
super(minvalue, maxvalue); |
|
||||||
} |
|
||||||
|
|
||||||
protected void clickButton(int select) { |
|
||||||
setIndex(select); |
|
||||||
showPopupMenu(); |
|
||||||
} |
|
||||||
|
|
||||||
public JPanel initWindowPane(double preferredWidth) { |
|
||||||
// 下拉的时候重新生成面板,刷新最近使用颜色
|
|
||||||
colorPane = new NewColorSelectPane(false) { |
|
||||||
@Override |
|
||||||
public void setVisible(boolean b) { |
|
||||||
super.setVisible(b); |
|
||||||
} |
|
||||||
|
|
||||||
@Override |
|
||||||
protected boolean selectRealTime() { |
|
||||||
return false; |
|
||||||
} |
|
||||||
}; |
|
||||||
colorPane.addChangeListener(new ChangeListener() { |
|
||||||
public void stateChanged(ChangeEvent e) { |
|
||||||
hidePopupMenu(); |
|
||||||
setColor(((NewColorSelectPane) e.getSource()).getColor()); |
|
||||||
getList().get(getIndex()).setColorInner(getColor()); |
|
||||||
fireDisplayComponent(ColorBackground.getInstance(getColor())); |
|
||||||
FixedGradientBarWithPopMenu.this.stateChanged(); |
|
||||||
} |
|
||||||
}); |
|
||||||
return colorPane; |
|
||||||
} |
|
||||||
|
|
||||||
} |
|
Loading…
Reference in new issue