@ -1,54 +0,0 @@ |
|||||||
package com.fr.quickeditor; |
|
||||||
|
|
||||||
import com.fr.base.chart.BaseChartCollection; |
|
||||||
//import com.fr.chart.chartattr.ChartCollection;
|
|
||||||
import com.fr.design.designer.TargetComponent; |
|
||||||
import com.fr.design.gui.chart.BaseChartPropertyPane; |
|
||||||
import com.fr.design.mainframe.ElementCasePane; |
|
||||||
import com.fr.design.module.DesignModuleFactory; |
|
||||||
import com.fr.design.selection.QuickEditor; |
|
||||||
import com.fr.grid.selection.CellSelection; |
|
||||||
import com.fr.grid.selection.FloatSelection; |
|
||||||
import com.fr.grid.selection.Selection; |
|
||||||
import com.fr.poly.PolyDesigner; |
|
||||||
import com.fr.poly.creator.ChartBlockEditor; |
|
||||||
import com.fr.report.cell.Elem; |
|
||||||
|
|
||||||
import java.awt.*; |
|
||||||
|
|
||||||
public class ChartQuickEditor extends QuickEditor<TargetComponent>{ |
|
||||||
// kunsnat: editingPropertyPane初始化 避开设计器启动, 在用到的时候再初始化.
|
|
||||||
//private BaseChartPropertyPane editingPropertyPane = null;
|
|
||||||
public ChartQuickEditor() { |
|
||||||
setLayout(new BorderLayout()); |
|
||||||
setBorder(null); |
|
||||||
} |
|
||||||
|
|
||||||
@Override |
|
||||||
protected void refresh() { |
|
||||||
BaseChartPropertyPane editingPropertyPane = null; |
|
||||||
BaseChartCollection collection = null; |
|
||||||
if(tc instanceof PolyDesigner) { |
|
||||||
ChartBlockEditor chartBlockEditor = (ChartBlockEditor)((PolyDesigner)tc).getSelection().getEditor(); |
|
||||||
collection = chartBlockEditor.getValue().getChartCollection(); |
|
||||||
|
|
||||||
add(editingPropertyPane = DesignModuleFactory.getChartPropertyPane(), BorderLayout.CENTER); |
|
||||||
editingPropertyPane.setSupportCellData(false); |
|
||||||
} else { |
|
||||||
Selection selection = ((ElementCasePane)tc).getSelection(); |
|
||||||
Elem element = null; |
|
||||||
if(selection instanceof CellSelection) { |
|
||||||
CellSelection cs = (CellSelection)selection; |
|
||||||
element = ((ElementCasePane)tc).getEditingElementCase().getCellElement(cs.getColumn(), cs.getRow()); |
|
||||||
} else if(selection instanceof FloatSelection){ |
|
||||||
FloatSelection fs = (FloatSelection)selection; |
|
||||||
element = ((ElementCasePane)tc).getEditingElementCase().getFloatElement(fs.getSelectedFloatName()); |
|
||||||
} |
|
||||||
collection = (BaseChartCollection) element.getValue(); |
|
||||||
add(editingPropertyPane = DesignModuleFactory.getChartPropertyPane(), BorderLayout.CENTER); |
|
||||||
|
|
||||||
} |
|
||||||
editingPropertyPane.populateChartPropertyPane(collection, tc); |
|
||||||
} |
|
||||||
|
|
||||||
} |
|
@ -0,0 +1,51 @@ |
|||||||
|
package com.fr.quickeditor.chartquick; |
||||||
|
|
||||||
|
import com.fr.base.chart.BaseChartCollection; |
||||||
|
import com.fr.design.actions.core.ActionFactory; |
||||||
|
import com.fr.design.actions.insert.cell.ChartCellAction; |
||||||
|
import com.fr.design.gui.chart.BaseChartPropertyPane; |
||||||
|
import com.fr.design.module.DesignModuleFactory; |
||||||
|
import com.fr.grid.selection.CellSelection; |
||||||
|
import com.fr.grid.selection.Selection; |
||||||
|
import com.fr.quickeditor.CellQuickEditor; |
||||||
|
import com.fr.report.cell.Elem; |
||||||
|
|
||||||
|
import javax.swing.*; |
||||||
|
|
||||||
|
|
||||||
|
public class BasicChartQuickEditor extends CellQuickEditor { |
||||||
|
private BaseChartPropertyPane editingPropertyPane; |
||||||
|
|
||||||
|
public BasicChartQuickEditor() { |
||||||
|
super(); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public JComponent createCenterBody() { |
||||||
|
editingPropertyPane = DesignModuleFactory.getChartPropertyPane(); |
||||||
|
editingPropertyPane.setBorder(BorderFactory.createEmptyBorder()); |
||||||
|
return editingPropertyPane; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public boolean isScrollAll() { |
||||||
|
return false; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public Object getComboBoxSelected() { |
||||||
|
return ActionFactory.createAction(ChartCellAction.class); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
protected void refreshDetails() { |
||||||
|
BaseChartCollection collection; |
||||||
|
Selection selection = tc.getSelection(); |
||||||
|
Elem element; |
||||||
|
CellSelection cs = (CellSelection) selection; |
||||||
|
element = tc.getEditingElementCase().getCellElement(cs.getColumn(), cs.getRow()); |
||||||
|
collection = (BaseChartCollection) element.getValue(); |
||||||
|
editingPropertyPane.populateChartPropertyPane(collection, tc); |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,34 @@ |
|||||||
|
package com.fr.quickeditor.chartquick; |
||||||
|
|
||||||
|
import com.fr.base.chart.BaseChartCollection; |
||||||
|
import com.fr.design.gui.chart.BaseChartPropertyPane; |
||||||
|
import com.fr.design.mainframe.ElementCasePane; |
||||||
|
import com.fr.design.module.DesignModuleFactory; |
||||||
|
import com.fr.design.selection.QuickEditor; |
||||||
|
import com.fr.grid.selection.FloatSelection; |
||||||
|
import com.fr.grid.selection.Selection; |
||||||
|
import com.fr.report.cell.Elem; |
||||||
|
|
||||||
|
import java.awt.*; |
||||||
|
|
||||||
|
|
||||||
|
public class FloatChartQuickEditor extends QuickEditor<ElementCasePane> { |
||||||
|
public FloatChartQuickEditor() { |
||||||
|
setLayout(new BorderLayout()); |
||||||
|
setBorder(null); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
protected void refresh() { |
||||||
|
BaseChartPropertyPane editingPropertyPane; |
||||||
|
BaseChartCollection collection; |
||||||
|
Selection selection = tc.getSelection(); |
||||||
|
Elem element; |
||||||
|
FloatSelection fs = (FloatSelection) selection; |
||||||
|
element = tc.getEditingElementCase().getFloatElement(fs.getSelectedFloatName()); |
||||||
|
collection = (BaseChartCollection) element.getValue(); |
||||||
|
add(editingPropertyPane = DesignModuleFactory.getChartPropertyPane(), BorderLayout.CENTER); |
||||||
|
editingPropertyPane.populateChartPropertyPane(collection, tc); |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,31 @@ |
|||||||
|
package com.fr.quickeditor.chartquick; |
||||||
|
|
||||||
|
import com.fr.base.chart.BaseChartCollection; |
||||||
|
import com.fr.design.designer.TargetComponent; |
||||||
|
import com.fr.design.gui.chart.BaseChartPropertyPane; |
||||||
|
import com.fr.design.module.DesignModuleFactory; |
||||||
|
import com.fr.design.selection.QuickEditor; |
||||||
|
import com.fr.poly.PolyDesigner; |
||||||
|
import com.fr.poly.creator.ChartBlockEditor; |
||||||
|
|
||||||
|
import java.awt.*; |
||||||
|
|
||||||
|
|
||||||
|
public class PolyChartQuickEditor extends QuickEditor<TargetComponent> { |
||||||
|
public PolyChartQuickEditor() { |
||||||
|
setLayout(new BorderLayout()); |
||||||
|
setBorder(null); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
protected void refresh() { |
||||||
|
BaseChartPropertyPane editingPropertyPane; |
||||||
|
BaseChartCollection collection; |
||||||
|
ChartBlockEditor chartBlockEditor = (ChartBlockEditor) ((PolyDesigner) tc).getSelection().getEditor(); |
||||||
|
collection = chartBlockEditor.getValue().getChartCollection(); |
||||||
|
add(editingPropertyPane = DesignModuleFactory.getChartPropertyPane(), BorderLayout.CENTER); |
||||||
|
editingPropertyPane.setSupportCellData(false); |
||||||
|
editingPropertyPane.populateChartPropertyPane(collection, tc); |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,65 @@ |
|||||||
|
package com.fr.design.editor.editor; |
||||||
|
|
||||||
|
import com.fr.base.Utils; |
||||||
|
import com.fr.design.gui.ispinner.UISpinner; |
||||||
|
import com.fr.design.layout.FRGUIPaneFactory; |
||||||
|
import com.fr.general.Inter; |
||||||
|
import com.fr.stable.StringUtils; |
||||||
|
|
||||||
|
import java.awt.*; |
||||||
|
import java.awt.event.KeyAdapter; |
||||||
|
import java.awt.event.KeyEvent; |
||||||
|
import java.awt.event.KeyListener; |
||||||
|
|
||||||
|
public class SpinnerIntegerEditor extends Editor<Integer> { |
||||||
|
|
||||||
|
private UISpinner spinner; |
||||||
|
private String oldValue = StringUtils.EMPTY; |
||||||
|
|
||||||
|
public SpinnerIntegerEditor(){ |
||||||
|
this.setLayout(FRGUIPaneFactory.createBorderLayout()); |
||||||
|
spinner = new UISpinner(-Integer.MAX_VALUE, Integer.MAX_VALUE, 1, 0); |
||||||
|
this.add(spinner, BorderLayout.CENTER); |
||||||
|
this.spinner.addKeyListener(textKeyListener); |
||||||
|
this.setName(Inter.getLocText("FR-Designer_Parameter_Integer")); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public Integer getValue() { |
||||||
|
return new Integer((int) this.spinner.getValue()); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void setValue(Integer value) { |
||||||
|
if (value == null) { |
||||||
|
value = new Integer(0); |
||||||
|
} |
||||||
|
this.spinner.setValue(value.intValue()); |
||||||
|
oldValue = Utils.objectToString(value); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public boolean accept(Object object) { |
||||||
|
return object != null && object instanceof Integer; |
||||||
|
} |
||||||
|
|
||||||
|
public String getIconName() { |
||||||
|
return "type_int"; |
||||||
|
} |
||||||
|
|
||||||
|
KeyListener textKeyListener = new KeyAdapter() { |
||||||
|
|
||||||
|
public void keyReleased(KeyEvent evt) { |
||||||
|
int code = evt.getKeyCode(); |
||||||
|
|
||||||
|
if (code == KeyEvent.VK_ESCAPE) { |
||||||
|
spinner.setValue(Double.parseDouble(oldValue)); |
||||||
|
} |
||||||
|
if (code == KeyEvent.VK_ENTER) { |
||||||
|
fireEditingStopped(); |
||||||
|
} else { |
||||||
|
fireStateChanged(); |
||||||
|
} |
||||||
|
} |
||||||
|
}; |
||||||
|
} |
Before Width: | Height: | Size: 362 B After Width: | Height: | Size: 440 B |
Before Width: | Height: | Size: 310 B After Width: | Height: | Size: 317 B |
Before Width: | Height: | Size: 468 B After Width: | Height: | Size: 522 B |
Before Width: | Height: | Size: 306 B After Width: | Height: | Size: 299 B |
Before Width: | Height: | Size: 509 B After Width: | Height: | Size: 395 B |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 317 B |
Before Width: | Height: | Size: 151 B After Width: | Height: | Size: 138 B |
After Width: | Height: | Size: 106 B |
After Width: | Height: | Size: 106 B |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 100 B |
After Width: | Height: | Size: 218 B |
After Width: | Height: | Size: 241 B |
After Width: | Height: | Size: 190 B |
After Width: | Height: | Size: 242 B |
@ -1,14 +0,0 @@ |
|||||||
package com.fr.design.mainframe.hold; |
|
||||||
|
|
||||||
import com.fr.design.fun.impl.AbstractTitleProcessor; |
|
||||||
|
|
||||||
import java.awt.*; |
|
||||||
|
|
||||||
public class DefaultTitlePlace extends AbstractTitleProcessor { |
|
||||||
|
|
||||||
@Override |
|
||||||
public void hold(Container container, Component loggerComponent, Component loginComponent) { |
|
||||||
container.add(loggerComponent, BorderLayout.WEST); |
|
||||||
container.add(loginComponent, BorderLayout.EAST); |
|
||||||
} |
|
||||||
} |
|
Before Width: | Height: | Size: 489 B After Width: | Height: | Size: 493 B |