|
|
|
@ -1,11 +1,11 @@
|
|
|
|
|
package com.fr.van.chart.designer.component; |
|
|
|
|
|
|
|
|
|
import com.fine.theme.utils.FineLayoutBuilder; |
|
|
|
|
import com.fr.chart.chartattr.Chart; |
|
|
|
|
import com.fr.design.beans.BasicBeanPane; |
|
|
|
|
import com.fr.design.constants.LayoutConstants; |
|
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
|
|
import com.fr.design.gui.ispinner.UISpinner; |
|
|
|
|
import com.fr.design.layout.TableLayout; |
|
|
|
|
import com.fr.design.layout.TableLayoutHelper; |
|
|
|
|
|
|
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
|
|
|
|
|
@ -13,11 +13,15 @@ import javax.swing.JPanel;
|
|
|
|
|
import java.awt.BorderLayout; |
|
|
|
|
import java.awt.Component; |
|
|
|
|
|
|
|
|
|
import static com.fine.swing.ui.layout.Layouts.cell; |
|
|
|
|
import static com.fine.swing.ui.layout.Layouts.column; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 悬浮位置 标题和图例用到 |
|
|
|
|
*/ |
|
|
|
|
public class VanChartFloatPositionPane extends BasicBeanPane<Chart> { |
|
|
|
|
private static final long serialVersionUID = -4773313488161065678L; |
|
|
|
|
private static final int VERTICAL_GAP = 8; |
|
|
|
|
private UISpinner floatPosition_x; |
|
|
|
|
private UISpinner floatPosition_y; |
|
|
|
|
|
|
|
|
@ -25,24 +29,21 @@ public class VanChartFloatPositionPane extends BasicBeanPane<Chart> {
|
|
|
|
|
|
|
|
|
|
this.setLayout(new BorderLayout()); |
|
|
|
|
|
|
|
|
|
this.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_XY_From_UpLeft")), BorderLayout.CENTER); |
|
|
|
|
|
|
|
|
|
this.add(createCustomFloatPositionPane(), BorderLayout.SOUTH); |
|
|
|
|
this.add(column(VERTICAL_GAP, |
|
|
|
|
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_XY_From_UpLeft"))), |
|
|
|
|
cell(createCustomFloatPositionPane())).getComponent()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private JPanel createCustomFloatPositionPane(){ |
|
|
|
|
floatPosition_x = new UISpinner(0,100,1,0); |
|
|
|
|
floatPosition_y = new UISpinner(0,100,1,0); |
|
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
|
double f = TableLayout.FILL; |
|
|
|
|
double[] columnSize = {p, f}; |
|
|
|
|
double[] rowSize = {p,p}; |
|
|
|
|
|
|
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
|
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_positionX")+": "),floatPosition_x}, |
|
|
|
|
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_positionY")+": "),floatPosition_y} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); |
|
|
|
|
return FineLayoutBuilder.compatibleTableLayout(VERTICAL_GAP, components, new double[]{LayoutConstants.LEFT_WEIGHT, LayoutConstants.RIGHT_WEIGHT}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void setFloatPosition_x(double floatPosition_x) { |
|
|
|
|