Browse Source

Merge branch 'feature/10.0' of ssh://cloud.finedevelop.com:7999/~zheng/C-design into feature/10.0

research/11.0
zheng 5 years ago
parent
commit
d7b30f27d2
  1. 6
      designer-base/src/main/java/com/fr/design/gui/ibutton/UIBasicButtonUI.java
  2. 2
      designer-base/src/main/java/com/fr/design/gui/ibutton/UIButton.java
  3. 2
      designer-base/src/main/java/com/fr/design/gui/ibutton/UISliderButton.java
  4. 2
      designer-base/src/main/java/com/fr/design/gui/ibutton/UISliderButtonUI.java
  5. 45
      designer-base/src/main/java/com/fr/design/layout/TableLayout.java
  6. 23
      designer-chart/src/main/java/com/fr/design/chartx/StructureChartDataPane.java
  7. 86
      designer-chart/src/main/java/com/fr/design/chartx/fields/diff/StructureCellDataFieldsPane.java
  8. 91
      designer-chart/src/main/java/com/fr/design/chartx/fields/diff/StructureDataSetFieldsPane.java
  9. 2
      designer-chart/src/main/java/com/fr/design/chartx/fields/diff/WordCloudCellDataFieldsPane.java
  10. 5
      designer-chart/src/main/java/com/fr/van/chart/structure/desinger/StructureIndependentVanChartInterface.java
  11. 18
      designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java
  12. 1
      designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java
  13. 2
      designer-form/src/main/java/com/fr/design/mainframe/FormToolBar.java
  14. 2
      designer-form/src/main/java/com/fr/design/mainframe/FormToolBarPane.java
  15. 1
      designer-form/src/main/java/com/fr/design/mainframe/JForm.java
  16. 6
      designer-form/src/main/java/com/fr/design/mainframe/widget/UITreeComboBox.java

6
designer-base/src/main/java/com/fr/design/gui/ibutton/UIBasicButtonUI.java

@ -321,9 +321,9 @@ public class UIBasicButtonUI extends MetalButtonUI {
//harry: 画带有高光的按钮。
private void drawHighLightButton(Graphics2D g2, Color color1, Color color2, int w, int h) {
GradientPaint buttonPaint = new GradientPaint(0, 0, color1, 0, h - 1, color2);
GradientPaint buttonHighLightPaint = new GradientPaint(0, 0, new Color(1.0f, 1.0f, 1.0f, 0.6f), 0, h / 2, new Color(1.0f, 1.0f, 1.0f, 0.2f));
GradientPaint buttonHighLightLinePaint = new GradientPaint(1, 1, new Color(1.0f, 1.0f, 1.0f, 0.8f), 0, h / 2, new Color(1.0f, 1.0f, 1.0f, 0.4f));
GradientPaint buttonPaint = new GradientPaint(0, 0, color1, 0, h - 1f, color2);
GradientPaint buttonHighLightPaint = new GradientPaint(0, 0, new Color(1.0f, 1.0f, 1.0f, 0.6f), 0, h / 2f, new Color(1.0f, 1.0f, 1.0f, 0.2f));
GradientPaint buttonHighLightLinePaint = new GradientPaint(1, 1, new Color(1.0f, 1.0f, 1.0f, 0.8f), 0, h / 2f, new Color(1.0f, 1.0f, 1.0f, 0.4f));
g2.setPaint(buttonPaint);
g2.fillRoundRect(0, 0, w - 1, h - 1, 3, 3);
g2.setPaint(buttonHighLightLinePaint);//按钮内侧高光线(内发光,0%阻塞)

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

@ -251,7 +251,7 @@ public class UIButton extends JButton implements UIObserver, UITextComponent {
protected void paintOtherBorder(Graphics g) {
Graphics2D g2d = (Graphics2D) g;
g2d.setStroke(borderStroke);
Shape shape = new RoundRectangle2D.Float(0.5f, 0.5f, getWidth() - 1, getHeight() - 1, UIConstants.ARC, UIConstants.ARC);
Shape shape = new RoundRectangle2D.Float(0.5f, 0.5f, getWidth() - 1f, getHeight() - 1f, UIConstants.ARC, UIConstants.ARC);
g2d.setColor(borderColor);
g2d.draw(shape);
}

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

@ -232,7 +232,7 @@ public class UISliderButton extends JButton implements UIObserver {
protected void paintOtherBorder(Graphics g) {
Graphics2D g2d = (Graphics2D) g;
g2d.setStroke(borderStroke);
Shape shape = new RoundRectangle2D.Float(0.5f, 0.5f, getWidth() - 1, getHeight() - 1, UIConstants.ARC, UIConstants.ARC);
Shape shape = new RoundRectangle2D.Float(0.5f, 0.5f, getWidth() - 1f, getHeight() - 1f, UIConstants.ARC, UIConstants.ARC);
g2d.setColor(borderColor);
g2d.draw(shape);
}

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

@ -176,7 +176,7 @@ public class UISliderButtonUI extends BasicButtonUI {
private void fillNormal(Graphics2D g2d, int x, int y, int width, int height, boolean isRound, int rectDirection, boolean isAuthorityEdited, boolean isPressedPainted) {
GradientPaint gp;
if (DesignerMode.isAuthorityEditing() && isAuthorityEdited) {
gp = new GradientPaint(1, 1, UIConstants.AUTHORITY_BLUE, 1, height - 1, UIConstants.AUTHORITY_DARK_BLUE);
gp = new GradientPaint(1, 1, UIConstants.AUTHORITY_BLUE, 1, height - 1f, UIConstants.AUTHORITY_DARK_BLUE);
} else if (isPressedPainted) {
gp = new GradientPaint(1, 1, UIConstants.SELECT_TAB, 1, height - 1, UIConstants.SELECT_TAB);
}else{

45
designer-base/src/main/java/com/fr/design/layout/TableLayout.java

@ -1,6 +1,9 @@
package com.fr.design.layout;
import com.fr.general.GeneralUtils;
import com.fr.stable.CommonUtils;
import java.awt.Component;
import java.awt.ComponentOrientation;
import java.awt.Container;
@ -12,8 +15,6 @@ import java.lang.reflect.Method;
import java.util.LinkedList;
import java.util.ListIterator;
import com.fr.general.GeneralUtils;
/**
* <p>TableLayout is a layout manager that is more powerful than GridBagLayout
@ -853,9 +854,9 @@ public class TableLayout implements LayoutManager2, Serializable {
// Make sure row size is valid
if ((size < 0.0) &&
(size != FILL) &&
(size != PREFERRED) &&
(size != MINIMUM)) {
(!CommonUtils.equals(size, FILL)) &&
(!CommonUtils.equals(size, PREFERRED)) &&
(!CommonUtils.equals(size, MINIMUM))) {
size = 0.0;
}
@ -1177,7 +1178,7 @@ public class TableLayout implements LayoutManager2, Serializable {
int numCr = crSpec[z].length;
for (int counter = 0; counter < numCr; counter++)
if ((crSpec[z][counter] >= 1.0) || (crSpec[z][counter] == 0.0)) {
if ((crSpec[z][counter] >= 1.0) || CommonUtils.equals(crSpec[z][counter], 0.0)) {
crSize[z][counter] = (int) (crSpec[z][counter] + 0.5);
availableSize -= crSize[z][counter];
}
@ -1229,7 +1230,7 @@ public class TableLayout implements LayoutManager2, Serializable {
int numCr = crSpec[z].length;
for (int counter = 0; counter < numCr; counter++)
if (crSpec[z][counter] == FILL)
if (CommonUtils.equals(crSpec[z][counter], FILL))
numFillSize++;
// If numFillSize is zero, the if statement below will always evaluate to
@ -1241,7 +1242,7 @@ public class TableLayout implements LayoutManager2, Serializable {
// Assign "fill" cells equal amounts of the remaining space
for (int counter = 0; counter < numCr; counter++)
if (crSpec[z][counter] == FILL) {
if (CommonUtils.equals(crSpec[z][counter], FILL)) {
crSize[z][counter] = availableSize / numFillSize;
slackSize -= crSize[z][counter];
}
@ -1249,7 +1250,7 @@ public class TableLayout implements LayoutManager2, Serializable {
// Assign one pixel of slack to each FILL cr, starting at the last one,
// until all slack has been consumed
for (int counter = numCr - 1; (counter >= 0) && (slackSize > 0); counter--) {
if (crSpec[z][counter] == FILL) {
if (CommonUtils.equals(crSpec[z][counter], FILL)) {
crSize[z][counter]++;
slackSize--;
}
@ -1299,7 +1300,7 @@ public class TableLayout implements LayoutManager2, Serializable {
// Address every cr
for (int counter = 0; counter < numCr; counter++)
// Is the current cr a preferred/minimum (based on typeOfSize) size
if (crSpec[z][counter] == typeOfSize) {
if (CommonUtils.equals(crSpec[z][counter], typeOfSize)) {
// Assume a maximum width of zero
int maxSize = 0;
@ -1319,7 +1320,7 @@ public class TableLayout implements LayoutManager2, Serializable {
// the current component occupies
if ((entry.cr1[z] <= counter) && (entry.cr2[z] >= counter)) {
// Setup size and number of adjustable crs
Dimension p = (typeOfSize == PREFERRED) ?
Dimension p = CommonUtils.equals(typeOfSize, PREFERRED) ?
entry.component.getPreferredSize() :
entry.component.getMinimumSize();
@ -1328,23 +1329,23 @@ public class TableLayout implements LayoutManager2, Serializable {
int numAdjustable = 0;
// Calculate for preferred size
if (typeOfSize == PREFERRED)
if (CommonUtils.equals(typeOfSize, PREFERRED))
// Consider all crs this component occupies
for (int entryCr = entry.cr1[z];
entryCr <= entry.cr2[z]; entryCr++) {
// Subtract absolute, relative, and minumum cr
// sizes, which have already been calculated
if ((crSpec[z][entryCr] >= 0.0) ||
(crSpec[z][entryCr] == MINIMUM)) {
CommonUtils.equals(crSpec[z][entryCr], MINIMUM)) {
size -= crSize[z][entryCr];
}
// Count preferred/min width columns
else if (crSpec[z][entryCr] == PREFERRED)
else if (CommonUtils.equals(crSpec[z][entryCr], PREFERRED))
numAdjustable++;
// Skip any component that occupies a fill cr
// because the fill should fulfill the size
// requirements
else if (crSpec[z][entryCr] == FILL)
// Skip any component that occupies a fill cr
// because the fill should fulfill the size
// requirements
else if (CommonUtils.equals(crSpec[z][entryCr], FILL))
continue nextComponent;
}
// Calculate for minimum size
@ -1357,14 +1358,14 @@ public class TableLayout implements LayoutManager2, Serializable {
if (crSpec[z][entryCr] >= 0.0)
size -= crSize[z][entryCr];
// Count preferred/min width columns
else if ((crSpec[z][entryCr] == PREFERRED) ||
(crSpec[z][entryCr] == MINIMUM)) {
else if (CommonUtils.equals(crSpec[z][entryCr], PREFERRED) ||
CommonUtils.equals(crSpec[z][entryCr], MINIMUM)) {
numAdjustable++;
}
// Skip any component that occupies a fill cr
// because the fill should fulfill the size
// requirements
else if (crSpec[z][entryCr] == FILL)
else if (CommonUtils.equals(crSpec[z][entryCr], FILL))
continue nextComponent;
}
@ -1692,7 +1693,7 @@ public class TableLayout implements LayoutManager2, Serializable {
Dimension prefMinSize[] = new Dimension[numEntry];
for (int i = 0; i < numEntry; i++)
prefMinSize[i] = (typeOfSize == PREFERRED) ?
prefMinSize[i] = CommonUtils.equals(typeOfSize, PREFERRED) ?
entryList[i].component.getPreferredSize() :
entryList[i].component.getMinimumSize();

23
designer-chart/src/main/java/com/fr/design/chartx/StructureChartDataPane.java

@ -0,0 +1,23 @@
package com.fr.design.chartx;
import com.fr.design.chartx.fields.diff.StructureCellDataFieldsPane;
import com.fr.design.chartx.fields.diff.StructureDataSetFieldsPane;
import com.fr.design.chartx.single.SingleDataPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
/**
* @author Bjorn
* @version 10.0
* Created by Bjorn on 2019-09-02
*/
public class StructureChartDataPane extends MultiCategoryChartDataPane {
public StructureChartDataPane(AttributeChangeListener listener) {
super(listener);
}
@Override
protected SingleDataPane createSingleDataPane() {
return new SingleDataPane(new StructureDataSetFieldsPane(), new StructureCellDataFieldsPane());
}
}

86
designer-chart/src/main/java/com/fr/design/chartx/fields/diff/StructureCellDataFieldsPane.java

@ -0,0 +1,86 @@
package com.fr.design.chartx.fields.diff;
import com.fr.chartx.data.field.diff.StructureColumnFieldCollection;
import com.fr.design.chartx.fields.AbstractCellDataFieldsPane;
import com.fr.design.formula.TinyFormulaPane;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.i18n.Toolkit;
import java.awt.Component;
/**
* @author Bjorn
* @version 10.0
* Created by Bjorn on 2019-09-02
*/
public class StructureCellDataFieldsPane extends AbstractCellDataFieldsPane<StructureColumnFieldCollection> {
private TinyFormulaPane nodeName;
private TinyFormulaPane nodeId;
private TinyFormulaPane parentId;
private UITextField seriesName;
private TinyFormulaPane nodeValue;
@Override
protected void initComponents() {
seriesName = new UITextField();
nodeName = new TinyFormulaPane();
nodeId = new TinyFormulaPane();
parentId = new TinyFormulaPane();
nodeValue = new TinyFormulaPane();
super.initComponents();
}
@Override
protected String[] fieldLabels() {
return new String[]{
Toolkit.i18nText("Fine-Design_Chart_Node_Name"),
"id",
Toolkit.i18nText("Fine-Design_Chart_Parent_ID"),
Toolkit.i18nText("Fine-Design_Chart_MultiPie_Series_Name"),
Toolkit.i18nText("Fine-Design_Chart_Series_Value"),
};
}
@Override
protected TinyFormulaPane[] formulaPanes() {
return new TinyFormulaPane[]{
nodeName,
nodeId,
parentId,
nodeValue
};
}
@Override
protected Component[] fieldComponents() {
return new Component[]{
nodeName,
nodeId,
parentId,
nodeValue,
nodeValue,
};
}
@Override
public void populateBean(StructureColumnFieldCollection ob) {
seriesName.setText(ob.getSeriesName());
populateField(nodeName, ob.getNodeName());
populateField(nodeId, ob.getNodeId());
populateField(parentId, ob.getParentId());
populateField(nodeValue, ob.getNodeValue());
}
@Override
public StructureColumnFieldCollection updateBean() {
StructureColumnFieldCollection result = new StructureColumnFieldCollection();
result.setSeriesName(seriesName.getText());
updateField(nodeName, result.getNodeName());
updateField(nodeId, result.getNodeId());
updateField(parentId, result.getParentId());
updateField(nodeValue, result.getNodeValue());
return result;
}
}

91
designer-chart/src/main/java/com/fr/design/chartx/fields/diff/StructureDataSetFieldsPane.java

@ -0,0 +1,91 @@
package com.fr.design.chartx.fields.diff;
import com.fr.chartx.data.field.diff.StructureColumnFieldCollection;
import com.fr.design.chartx.fields.AbstractDataSetFieldsPane;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.chart.gui.data.CalculateComboBox;
import java.awt.Component;
/**
* @author Bjorn
* @version 10.0
* Created by Bjorn on 2019-09-02
*/
public class StructureDataSetFieldsPane extends AbstractDataSetFieldsPane<StructureColumnFieldCollection> {
private UIComboBox nodeName;
private UIComboBox nodeId;
private UIComboBox parentId;
private UITextField seriesName;
private UIComboBox nodeValue;
private CalculateComboBox calculateCombox;
@Override
protected void initComponents() {
nodeName = new UIComboBox();
nodeId = new UIComboBox();
parentId = new UIComboBox();
seriesName = new UITextField();
nodeValue = new UIComboBox();
calculateCombox = new CalculateComboBox();
super.initComponents();
}
@Override
protected String[] fieldLabels() {
return new String[]{
Toolkit.i18nText("Fine-Design_Chart_Node_Name"),
"id",
Toolkit.i18nText("Fine-Design_Chart_Parent_ID"),
Toolkit.i18nText("Fine-Design_Chart_MultiPie_Series_Name"),
Toolkit.i18nText("Fine-Design_Chart_Series_Value"),
Toolkit.i18nText("Fine-Design_Chart_Summary_Method")
};
}
@Override
protected UIComboBox[] filedComboBoxes() {
return new UIComboBox[]{
nodeName,
nodeId,
parentId,
nodeValue
};
}
@Override
protected Component[] fieldComponents() {
return new Component[]{
nodeName,
nodeId,
parentId,
nodeValue,
nodeValue,
calculateCombox
};
}
@Override
public void populateBean(StructureColumnFieldCollection ob) {
seriesName.setText(ob.getSeriesName());
populateField(nodeName, ob.getNodeName());
populateField(nodeId, ob.getNodeId());
populateField(parentId, ob.getParentId());
populateFunctionField(nodeValue, calculateCombox, ob.getNodeValue());
}
@Override
public StructureColumnFieldCollection updateBean() {
StructureColumnFieldCollection result = new StructureColumnFieldCollection();
result.setSeriesName(seriesName.getText());
updateField(nodeName, result.getNodeName());
updateField(nodeId, result.getNodeId());
updateField(parentId, result.getParentId());
updateFunctionField(nodeValue, calculateCombox, result.getNodeValue());
return result;
}
}

2
designer-chart/src/main/java/com/fr/design/chartx/fields/diff/WordCloudCellDataFieldsPane.java

@ -64,7 +64,7 @@ public class WordCloudCellDataFieldsPane extends AbstractCellDataFieldsPane<Word
WordCloudColumnFieldCollection result = new WordCloudColumnFieldCollection();
result.setTargetName(name.getText());
updateField(wordName, result.getWordName());
populateField(wordValue, result.getWordValue());
updateField(wordValue, result.getWordValue());
return result;
}
}

5
designer-chart/src/main/java/com/fr/van/chart/structure/desinger/StructureIndependentVanChartInterface.java

@ -95,4 +95,9 @@ public class StructureIndependentVanChartInterface extends AbstractIndependentVa
public ConditionAttributesPane getPlotConditionPane(Plot plot) {
return new VanChartStructureConditionPane(plot);
}
/* @Override
public ChartDataPane getChartDataPane(AttributeChangeListener listener) {
return new StructureChartDataPane(listener);
}*/
}

18
designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java

@ -148,6 +148,9 @@ public class FormCreatorDropTarget extends DropTarget {
// 取消前一个焦点容器的提示渲染器
designer.setPainter(null);
}
if (container == null) {
throw new IllegalArgumentException("container can not be null!");
}
//获取painter的时候要考虑布局之间嵌套的问题
XLayoutContainer xLayoutContainer = container.getTopLayout();
if (xLayoutContainer != null && xLayoutContainer.getParent() != null
@ -215,7 +218,8 @@ public class FormCreatorDropTarget extends DropTarget {
*
* @param dtde 事件
*/
public void dragEnter(DropTargetDragEvent dtde) {
@Override
public synchronized void dragEnter(DropTargetDragEvent dtde) {
Point loc = dtde.getLocation();
this.entering(loc.x, loc.y);
}
@ -225,7 +229,8 @@ public class FormCreatorDropTarget extends DropTarget {
*
* @param dtde 事件
*/
public void dragOver(DropTargetDragEvent dtde) {
@Override
public synchronized void dragOver(DropTargetDragEvent dtde) {
Point loc = dtde.getLocation();
hovering(loc.x, loc.y);
}
@ -235,7 +240,8 @@ public class FormCreatorDropTarget extends DropTarget {
*
* @param dtde 事件
*/
public void dropActionChanged(DropTargetDragEvent dtde) {
@Override
public synchronized void dropActionChanged(DropTargetDragEvent dtde) {
}
/**
@ -243,7 +249,8 @@ public class FormCreatorDropTarget extends DropTarget {
*
* @param dte 事件
*/
public void dragExit(DropTargetEvent dte) {
@Override
public synchronized void dragExit(DropTargetEvent dte) {
this.exiting();
}
@ -252,7 +259,8 @@ public class FormCreatorDropTarget extends DropTarget {
*
* @param dtde 事件
*/
public void drop(DropTargetDropEvent dtde) {
@Override
public synchronized void drop(DropTargetDropEvent dtde) {
Point loc = dtde.getLocation();
this.adding(loc.x, loc.y);
//针对在表单中拖入一个控件直接ctrl+s无反应

1
designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java

@ -1368,6 +1368,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
Thread.sleep(1500);
} catch (InterruptedException e) {
FRLogger.getLogger().error(e.getMessage(), e);
Thread.currentThread().interrupt();
}
pane.setLayout(new BorderLayout());

2
designer-form/src/main/java/com/fr/design/mainframe/FormToolBar.java

@ -20,7 +20,7 @@ public class FormToolBar {
}
public void setButtonlist(List<FormToolBarButton> buttonlist) {
if (buttonlist == null || buttonlist.size() < 0) {
if (buttonlist == null) {
this.buttonlist = new ArrayList<FormToolBarButton>();
} else {
this.buttonlist = buttonlist;

2
designer-form/src/main/java/com/fr/design/mainframe/FormToolBarPane.java

@ -118,7 +118,7 @@ public class FormToolBarPane extends BasicBeanPane<ToolBar> {
}
private void setToolBar(List<FormToolBarButton> list) {
if (list == null || list.size() < 0) {
if (list == null) {
return;
}
this.removeAll();

1
designer-form/src/main/java/com/fr/design/mainframe/JForm.java

@ -765,6 +765,7 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm<F
Thread.sleep(1500);
} catch (InterruptedException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
Thread.currentThread().interrupt();
}
JPanel pane = new JPanel();
pane.setLayout(new BorderLayout());

6
designer-form/src/main/java/com/fr/design/mainframe/widget/UITreeComboBox.java

@ -192,7 +192,11 @@ public class UITreeComboBox extends UIComboBox {
@Override
public boolean equals(Object o) {
return o.getClass() == this.getClass();
if (o != null) {
return o.getClass() == this.getClass();
} else {
return false;
}
}
}

Loading…
Cancel
Save