Changeset 3142
- Timestamp:
- 03/04/10 12:19:02 (2 years ago)
- Location:
- trunk/simexplorer-ide/simexplorer-ide-ant/org.openmole.ui/src
- Files:
-
- 5 added
- 40 modified
- 1 moved
-
org/openmole/ui/commons/ApplicationCustomize.java (modified) (2 diffs)
-
org/openmole/ui/control/ControlPanel.java (modified) (2 diffs)
-
org/openmole/ui/control/GenericTableView.java (modified) (2 diffs)
-
org/openmole/ui/control/TableMapping.java (modified) (2 diffs)
-
org/openmole/ui/control/TableModelMapping.java (added)
-
org/openmole/ui/control/TableType.java (modified) (2 diffs)
-
org/openmole/ui/example/MoleExample.java (modified) (6 diffs)
-
org/openmole/ui/example/MoleExampleStarter.java (modified) (2 diffs)
-
org/openmole/ui/workflow/action (added)
-
org/openmole/ui/workflow/implementation/ExpandControler.java (modified) (4 diffs)
-
org/openmole/ui/workflow/implementation/ExpandableContainerUI.java (modified) (2 diffs)
-
org/openmole/ui/workflow/implementation/ExplorationTaskModelUI.java (added)
-
org/openmole/ui/workflow/implementation/GenericMenuProvider.java (modified) (2 diffs)
-
org/openmole/ui/workflow/implementation/JobModelUI.java (modified) (1 diff)
-
org/openmole/ui/workflow/implementation/MoleScene.java (modified) (3 diffs)
-
org/openmole/ui/workflow/implementation/MoleSceneFactory.java (modified) (3 diffs)
-
org/openmole/ui/workflow/implementation/ObjectModelUI.java (modified) (2 diffs)
-
org/openmole/ui/workflow/implementation/ObjectViewUI.java (modified) (2 diffs)
-
org/openmole/ui/workflow/implementation/Preferences.java (added)
-
org/openmole/ui/workflow/implementation/TaskActions.java (modified) (3 diffs)
-
org/openmole/ui/workflow/implementation/TaskCapsuleModelUI.java (modified) (2 diffs)
-
org/openmole/ui/workflow/implementation/TaskCapsuleViewUI.java (modified) (4 diffs)
-
org/openmole/ui/workflow/implementation/TaskCompositeModelUI.java (modified) (3 diffs)
-
org/openmole/ui/workflow/implementation/TaskCompositeViewUI.java (modified) (5 diffs)
-
org/openmole/ui/workflow/implementation/TaskModelUI.java (modified) (3 diffs)
-
org/openmole/ui/workflow/implementation/TaskViewUI.java (modified) (2 diffs)
-
org/openmole/ui/workflow/implementation/TaskXXFactory.java (modified) (14 diffs)
-
org/openmole/ui/workflow/implementation/UIFactory.java (modified) (3 diffs)
-
org/openmole/ui/workflow/implementation/paint/BorderedRectangularPainter.java (modified) (1 diff)
-
org/openmole/ui/workflow/implementation/paint/BorderedRectangularProvider.java (modified) (5 diffs)
-
org/openmole/ui/workflow/implementation/paint/BorderedWidgetFactory.java (modified) (2 diffs)
-
org/openmole/ui/workflow/implementation/paint/ContainerUI.java (moved) (moved from trunk/simexplorer-ide/simexplorer-ide-ant/org.openmole.ui/src/org/openmole/ui/workflow/implementation/ContainerUI.java) (2 diffs)
-
org/openmole/ui/workflow/implementation/paint/IBorderedRectangularProvider.java (modified) (1 diff)
-
org/openmole/ui/workflow/implementation/paint/IOParameterWidget.java (modified) (2 diffs)
-
org/openmole/ui/workflow/implementation/paint/PainterWidget.java (modified) (2 diffs)
-
org/openmole/ui/workflow/implementation/paint/SelectionManager.java (added)
-
org/openmole/ui/workflow/model/IContainerUI.java (modified) (1 diff)
-
org/openmole/ui/workflow/model/IJobModelUI.java (modified) (1 diff)
-
org/openmole/ui/workflow/model/IObjectModelUI.java (modified) (2 diffs)
-
org/openmole/ui/workflow/model/IObjectViewUI.java (modified) (2 diffs)
-
org/openmole/ui/workflow/model/ITaskCapsuleModelUI.java (modified) (1 diff)
-
org/openmole/ui/workflow/model/ITaskCapsuleViewUI.java (modified) (2 diffs)
-
org/openmole/ui/workflow/model/ITaskModelUI.java (modified) (1 diff)
-
org/openmole/ui/workflow/model/ITaskViewUI.java (modified) (2 diffs)
-
org/openmole/ui/workflow/model/IUIFactory.java (modified) (2 diffs)
-
resources/inputArrow.png (modified) (previous)
Legend:
- Unmodified
- Added
- Removed
-
trunk/simexplorer-ide/simexplorer-ide-ant/org.openmole.ui/src/org/openmole/ui/commons/ApplicationCustomize.java
r3127 r3142 57 57 public static final Image IMAGE_OUTPUT_SLOT = ImageUtilities.loadImage("resources/outputSlot.png"); 58 58 59 public ApplicationCustomize() { 60 setDefaultColors(); 61 } 59 62 60 public ApplicationCustomize(Preferences prefs) {61 loadFromPreferences(prefs);62 }63 63 64 64 private void loadFromPreferences(Preferences prefs) { … … 86 86 } 87 87 88 public static ApplicationCustomize getInstance( Preferences prefs) {88 public static ApplicationCustomize getInstance() { 89 89 if (instance == null) { 90 instance = new ApplicationCustomize( prefs);90 instance = new ApplicationCustomize(); 91 91 } 92 92 return instance; -
trunk/simexplorer-ide/simexplorer-ide-ant/org.openmole.ui/src/org/openmole/ui/control/ControlPanel.java
r3129 r3142 6 6 import javax.swing.JSplitPane; 7 7 import javax.swing.JTabbedPane; 8 import org.openmole.ui.workflow.implementation.Preferences; 8 9 9 10 /** … … 21 22 super(new BorderLayout()); 22 23 23 24 25 24 moleTabbedPane = new JTabbedPane(); 26 25 tableTabbedPane = new JTabbedPane(); -
trunk/simexplorer-ide/simexplorer-ide-ant/org.openmole.ui/src/org/openmole/ui/control/GenericTableView.java
r3137 r3142 21 21 22 22 setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS); 23 getTableHeader().setBackground(ApplicationCustomize.getInstance( null).getColor(ApplicationCustomize.TABLE_HEADER_COLOR));23 getTableHeader().setBackground(ApplicationCustomize.getInstance().getColor(ApplicationCustomize.TABLE_HEADER_COLOR)); 24 24 } 25 25 … … 33 33 int Index_row, 34 34 int Index_col) { 35 Color col = ApplicationCustomize.getInstance( null).getColor(ApplicationCustomize.TABLE_ROW_COLOR);35 Color col = ApplicationCustomize.getInstance().getColor(ApplicationCustomize.TABLE_ROW_COLOR); 36 36 Component comp = super.prepareRenderer(renderer, Index_row, Index_col); 37 37 if (Index_row % 2 == 0 && !isCellSelected(Index_row, Index_col)) { -
trunk/simexplorer-ide/simexplorer-ide-ant/org.openmole.ui/src/org/openmole/ui/control/TableMapping.java
r3137 r3142 19 19 public static final String VALUE = "Value"; 20 20 public static final String OPTIONAL = "Optional"; 21 public static final String FACTOR = "Factor"; 22 public static final String BOUND_MIN = "Bound inf"; 23 public static final String BOUND_MAX = "Bound sup"; 21 24 22 25 private Map<Name, Collection<String>> tableMap = new HashMap(); … … 38 41 //output parmaters 39 42 tableMap.put(Name.OUTPUT_PARAMETER, li); 43 44 //design of experiment 45 Collection<String> lidod = new ArrayList<String>(); 46 lidod.add(FACTOR); 47 lidod.add(BOUND_MIN); 48 lidod.add(BOUND_MAX); 49 tableMap.put(Name.DESIGN_OF_EXPERIMENT, lidod); 50 40 51 } 41 52 -
trunk/simexplorer-ide/simexplorer-ide-ant/org.openmole.ui/src/org/openmole/ui/control/TableType.java
r3130 r3142 9 9 public enum Name { 10 10 INPUT_PARAMETER, 11 OUTPUT_PARAMETER 11 OUTPUT_PARAMETER, 12 DESIGN_OF_EXPERIMENT 12 13 } 13 14 … … 15 16 if (tn == Name.INPUT_PARAMETER) return "Input parameters"; 16 17 else if (tn == Name.OUTPUT_PARAMETER) return "Output parameters"; 18 else if (tn == Name.DESIGN_OF_EXPERIMENT) return "Design of experiment"; 17 19 18 20 return ""; -
trunk/simexplorer-ide/simexplorer-ide-ant/org.openmole.ui/src/org/openmole/ui/example/MoleExample.java
r2939 r3142 6 6 package org.openmole.ui.example; 7 7 8 import java.math.BigDecimal; 8 9 import org.simexplorer.core.commons.exception.InternalProcessingError; 9 10 import org.simexplorer.core.commons.exception.UserBadDataError; … … 11 12 import org.simexplorer.core.workflow.methods.task.JavaTask; 12 13 import org.simexplorer.core.commons.tools.IVisitor; 14 import org.simexplorer.core.workflow.implementation.capsule.ExplorationTaskCapsule; 13 15 import org.simexplorer.core.workflow.implementation.mole.Mole; 14 16 import org.simexplorer.core.workflow.implementation.mole.TransitionFactory; 17 import org.simexplorer.core.workflow.implementation.task.ExplorationTask; 15 18 import org.simexplorer.core.workflow.model.capsule.IGenericTaskCapsule; 19 import org.simexplorer.core.workflow.model.data.Prototype; 16 20 import org.simexplorer.core.workflow.model.mole.IMole; 17 21 import org.simexplorer.core.workflow.model.transition.ITransition; … … 28 32 static public IMole buildMole() throws UserBadDataError, InternalProcessingError, InterruptedException, InstantiationException { 29 33 JavaTask t1 = new JavaTask("t1"); 30 JavaTask t2 = new JavaTask("t2");34 ExplorationTask t2 = new ExplorationTask("expl"); 31 35 JavaTask t3 = new JavaTask("t3"); 32 36 JavaTask t4 = new JavaTask("t4"); … … 41 45 JavaTask t13 = new JavaTask("t13"); 42 46 47 Prototype<BigDecimal> i = new Prototype<BigDecimal>("i", BigDecimal.class); 48 t2.addInput(i,true); 49 t2.addOutput(i,true); 50 43 51 TaskCapsule t1Caps = new TaskCapsule(t1); 44 TaskCapsule t2Caps = newTaskCapsule(t2);52 ExplorationTaskCapsule t2Caps = new ExplorationTaskCapsule(t2); 45 53 TaskCapsule t3Caps = new TaskCapsule(t3); 46 54 TaskCapsule t4Caps = new TaskCapsule(t4); 47 55 TaskCapsule t5Caps = new TaskCapsule(t5); 48 56 TaskCapsule t6Caps = new TaskCapsule(t6); 49 TaskCapsule t7Caps = new TaskCapsule( t7);57 TaskCapsule t7Caps = new TaskCapsule(); 50 58 TaskCapsule t8Caps = new TaskCapsule(t8); 51 59 TaskCapsule t9Caps = new TaskCapsule(t9); … … 62 70 TransitionFactory.buildChain(t4Caps, t8Caps), 63 71 TransitionFactory.build(t10Caps));*/ 64 /*TransitionFactory.buildDiamond(TransitionFactory.build(t1Caps),65 TransitionFactory.buildChain(t 2Caps,t7Caps,t12Caps),72 /* TransitionFactory.buildDiamond(TransitionFactory.build(t1Caps), 73 TransitionFactory.buildChain(t7Caps,t12Caps), 66 74 TransitionFactory.buildChain(t3Caps,t8Caps), 67 75 TransitionFactory.buildChain(t4Caps,t9Caps), … … 69 77 TransitionFactory.buildChain(t6Caps,t11Caps), 70 78 TransitionFactory.build(t13Caps));*/ 71 72 TransitionFactory.build(t1Caps); 79 /* TransitionFactory.buildChain(TransitionFactory.build(t1Caps), 80 TransitionFactory.buildExploration(t2Caps, 81 TransitionFactory.buildChain(t3Caps,t4Caps), 82 t5Caps));*/ 83 TransitionFactory.buildChain(t1Caps,t7Caps); 73 84 IMole mole = new Mole(t1Caps); 74 85 75 printWorkflow(mole);86 // printWorkflow(mole); 76 87 //mole.run(); 77 88 return mole; -
trunk/simexplorer-ide/simexplorer-ide-ant/org.openmole.ui/src/org/openmole/ui/example/MoleExampleStarter.java
r3131 r3142 29 29 import org.openmole.ui.control.TableMapping; 30 30 import org.openmole.ui.workflow.implementation.MoleSceneFactory; 31 import org.openmole.ui.workflow.implementation.Preferences; 31 32 import org.simexplorer.core.commons.exception.InternalProcessingError; 32 33 import org.simexplorer.core.commons.exception.UserBadDataError; … … 51 52 52 53 TableMapping.getInstance().initialize(); 54 Preferences.getInstance().initialize(); 53 55 54 56 JTabbedPane moleTabbedPane = new JTabbedPane(); -
trunk/simexplorer-ide/simexplorer-ide-ant/org.openmole.ui/src/org/openmole/ui/workflow/implementation/ExpandControler.java
r3132 r3142 40 40 public ExpandControler(MoleScene scene, 41 41 StateModel stateModel, 42 Rectangle clientArea,43 42 Image imageE, 44 43 Image imageC, … … 52 51 titleWidget.setLayout(LayoutFactory.createHorizontalFlowLayout(align, 5)); 53 52 Widget emptyWidget = new Widget(scene); //Placeholder to place MinimizeIcon inside rounded rectangle 54 emptyWidget.setPreferredBounds(new Rectangle( TaskViewUI.ARROW_PIN_WIDTH, 0));53 emptyWidget.setPreferredBounds(new Rectangle(12, 0)); 55 54 titleWidget.addChild(emptyWidget); 56 55 … … 80 79 public ExpandControler(MoleScene scene, 81 80 StateModel stateModel, 82 Rectangle clientArea,83 81 Image imageE, 84 82 Image imageC) { … … 89 87 minimizeWidget.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); 90 88 minimizeWidget.getActions().addAction(new ToggleMinimizedAction(stateModel)); 91 setPreferredBounds(clientArea);92 89 addChild(minimizeWidget); 93 90 } -
trunk/simexplorer-ide/simexplorer-ide-ant/org.openmole.ui/src/org/openmole/ui/workflow/implementation/ExpandableContainerUI.java
r3122 r3142 17 17 package org.openmole.ui.workflow.implementation; 18 18 19 import org.openmole.ui.workflow.implementation.paint.ContainerUI; 19 20 import java.awt.Color; 20 21 import java.awt.Rectangle; … … 40 41 private StateModel stateModel; 41 42 42 @SuppressWarnings("LeakingThisInConstructor")43 43 public ExpandableContainerUI(MoleScene scene, 44 44 Rectangle clientArea, -
trunk/simexplorer-ide/simexplorer-ide-ant/org.openmole.ui/src/org/openmole/ui/workflow/implementation/GenericMenuProvider.java
r3122 r3142 11 11 import org.openmole.ui.workflow.model.IGenericMenuProvider; 12 12 import org.openmole.ui.workflow.model.IObjectModelUI; 13 import org.simexplorer.core.workflow.model.task.IGenericTask; 13 14 14 15 /** … … 16 17 * @author mathieu 17 18 */ 18 public class GenericMenuProvider <T>implements IGenericMenuProvider {19 public class GenericMenuProvider implements IGenericMenuProvider { 19 20 Collection<JMenuItem> items = new ArrayList<JMenuItem>() ; 20 21 Collection<JMenu> menus = new ArrayList<JMenu>() ; 21 IObjectModelUI <T>model;22 IObjectModelUI model; 22 23 23 public GenericMenuProvider(IObjectModelUI <T>m){24 public GenericMenuProvider(IObjectModelUI m){ 24 25 model = m; 25 26 } 27 28 /* 29 public class GenericMenuProvider implements IGenericMenuProvider { 30 Collection<JMenuItem> items = new ArrayList<JMenuItem>() ; 31 Collection<JMenu> menus = new ArrayList<JMenu>() ; 32 IObjectModelUI model; 33 34 public GenericMenuProvider(IObjectModelUI m){ 35 model = m; 36 }*/ 26 37 27 38 @Override -
trunk/simexplorer-ide/simexplorer-ide-ant/org.openmole.ui/src/org/openmole/ui/workflow/implementation/JobModelUI.java
r3088 r3142 12 12 public class JobModelUI implements IJobModelUI<IJob> { 13 13 14 @Override15 public void objectChanged(IJob obj) {16 System.out.println("The Job " + obj + "has been modified");17 }18 19 @Override20 public void setName(String jobName) {21 System.out.println("TNAME:"+ jobName);22 }23 14 } -
trunk/simexplorer-ide/simexplorer-ide-ant/org.openmole.ui/src/org/openmole/ui/workflow/implementation/MoleScene.java
r3135 r3142 17 17 import org.openmole.ui.workflow.model.IMoleScene; 18 18 import org.openmole.ui.workflow.model.IObjectViewUI; 19 import org.openmole.ui.workflow.model.ITaskModelUI; 19 20 import org.openmole.ui.workflow.model.ITaskViewUI; 20 21 import org.simexplorer.core.commons.exception.InternalProcessingError; … … 38 39 setPreferredSize(new Dimension((int)(ApplicationCustomize.SCREEN_WIDTH*0.8),(int)(ApplicationCustomize.SCREEN_HEIGHT*0.8))); 39 40 view = createView(); 41 40 42 } 41 43 … … 44 46 return view; 45 47 } 46 47 48 public IObjectViewUI createXXTask(IGenericTaskCapsule obj, 48 49 String n, 49 50 boolean composite) throws InternalProcessingError { 50 51 if (composite) { 51 // IObjectViewUI itxx = UIFactory.getInstance().create(obj.getAssignedTask(), this);52 52 obUI = new TaskCompositeViewUI(this, 53 (ITaskModelUI) UIFactory.getInstance().create(obj.getAssignedTask()), 53 54 n); 55 // obUI = new TaskViewUI(this, (ITaskModelUI) UIFactory.getInstance().create(obj.getAssignedTask()), n); 54 56 addNode(n); 55 57 } else { -
trunk/simexplorer-ide/simexplorer-ide-ant/org.openmole.ui/src/org/openmole/ui/workflow/implementation/MoleSceneFactory.java
r3135 r3142 6 6 7 7 import java.util.Iterator; 8 import java.util.Random;9 8 import org.simexplorer.core.commons.exception.InternalProcessingError; 10 9 import org.simexplorer.core.commons.exception.UserBadDataError; … … 13 12 import org.simexplorer.core.workflow.model.transition.ITransition; 14 13 import org.simexplorer.core.commons.tools.IVisitor; 15 import org.simexplorer.core.workflow.methods.task.JavaTask;16 14 import org.simexplorer.core.workflow.model.mole.IMole; 17 15 … … 64 62 IGenericTaskCapsule tCapsule) throws InternalProcessingError { 65 63 if (tCapsule.getTask() != null) { 66 String nodeID = "node" +String.valueOf(tCapsule.getTask().getName());64 String nodeID = String.valueOf(tCapsule.getTask().getName()); 67 65 if (!scene.getNodes().contains(nodeID)) { 68 66 scene.createXXTask(tCapsule, nodeID, true); -
trunk/simexplorer-ide/simexplorer-ide-ant/org.openmole.ui/src/org/openmole/ui/workflow/implementation/ObjectModelUI.java
r3135 r3142 3 3 4 4 import org.openmole.ui.workflow.model.IObjectModelUI; 5 import org.simexplorer.core.workflow.model.task.IGenericTask; 5 6 6 7 /** … … 8 9 * @author mathieu 9 10 */ 10 public abstract class ObjectModelUI <T>implements IObjectModelUI{11 public abstract class ObjectModelUI implements IObjectModelUI{ 11 12 12 13 // VisualizationRank rank; 13 14 // private Class businessClass; 14 15 @Override16 public abstract void setName(String objectName);17 15 } -
trunk/simexplorer-ide/simexplorer-ide-ant/org.openmole.ui/src/org/openmole/ui/workflow/implementation/ObjectViewUI.java
r3135 r3142 1 1 package org.openmole.ui.workflow.implementation; 2 2 3 import javax.swing.JTabbedPane; 3 import java.awt.Color; 4 import java.awt.Point; 5 import javax.swing.JOptionPane; 6 import org.netbeans.api.visual.action.ActionFactory; 7 import org.netbeans.api.visual.action.SelectProvider; 8 import org.netbeans.api.visual.widget.Scene; 4 9 import org.netbeans.api.visual.widget.Widget; 10 import org.openmole.ui.workflow.implementation.paint.PainterWidget; 5 11 import org.openmole.ui.workflow.model.IObjectViewUI; 12 import org.openmole.ui.workflow.model.ITaskModelUI; 6 13 7 14 /** … … 9 16 * @author mathieu 10 17 */ 11 public abstract class ObjectViewUI<T>extends Widget implements IObjectViewUI {18 public class ObjectViewUI extends Widget implements IObjectViewUI { 12 19 13 MoleScene scene; 14 protected JTabbedPane tableTabbedPane; 20 protected MoleScene scene; 21 protected PainterWidget pWidget; 22 private Color defaultBorderColor; 23 private Color defaultBackgroundColor; 15 24 16 public ObjectViewUI(MoleScene sc) { 17 super(sc); 18 scene = sc; 25 public ObjectViewUI(MoleScene scene, 26 Color defaultBackgroundColor, 27 Color defaultBorderColor) { 28 super(scene); 29 this.scene = scene; 30 this.defaultBorderColor = defaultBorderColor; 31 this.defaultBackgroundColor = defaultBackgroundColor; 32 pWidget = TaskXXFactory.getSelfContainer(scene); 33 setDefaultBackgroundColor(); 34 setDefaultBorderColor(); 35 getActions().addAction(ActionFactory.createMoveAction()); 36 } 37 38 39 public ObjectViewUI(MoleScene scene, 40 ITaskModelUI m, 41 Color dbac, 42 Color dboc) { 43 this(scene,dbac,dboc); 44 getActions().addAction(new TaskActions(m,this)); 45 46 // getActions().addAction(ActionFactory.createPopupMenuAction(gmp)); 47 } 48 49 @Override 50 public void setBackgroundColor(Color col) { 51 pWidget.setBackgroundColor(col); 52 } 53 54 @Override 55 public void setDefaultBackgroundColor() { 56 pWidget.setBackgroundColor(defaultBackgroundColor); 57 } 58 59 60 @Override 61 public void setBorderColor(Color col) { 62 pWidget.setBorderColor(col); 63 } 64 65 @Override 66 public void setDefaultBorderColor() { 67 pWidget.setBorderColor(defaultBorderColor); 19 68 } 20 69 } -
trunk/simexplorer-ide/simexplorer-ide-ant/org.openmole.ui/src/org/openmole/ui/workflow/implementation/TaskActions.java
r3135 r3142 6 6 import org.openmole.ui.control.ControlPanel; 7 7 import org.openmole.ui.control.TableModelMapping; 8 import org.openmole.ui.workflow.implementation.paint.SelectionManager; 9 import org.openmole.ui.workflow.model.IObjectViewUI; 8 10 import org.openmole.ui.workflow.model.ITaskModelUI; 9 11 … … 15 17 16 18 private ITaskModelUI model; 17 public TaskActions(ITaskModelUI m) { 19 private IObjectViewUI view; 20 21 public TaskActions(ITaskModelUI m, 22 IObjectViewUI v) { 18 23 model = m; 24 view = v; 19 25 } 20 26 21 27 @Override 22 public State mousePressed(Widget widget, WidgetMouseEvent event) { 28 public State mouseClicked(Widget widget, 29 WidgetMouseEvent event) { 23 30 try { 31 SelectionManager.getInstance().setSelected(view); 24 32 ControlPanel.getInstance().switchTableTabbedPane(TableModelMapping.getInstance().getTabbedPane(model)); 25 33 model.updateData(); … … 31 39 return State.REJECTED; 32 40 } 41 42 @Override 43 public State mouseMoved(Widget widget, 44 WidgetAction.WidgetMouseEvent event){ 45 mouseClicked(widget, event); 46 return State.REJECTED; 47 } 33 48 } -
trunk/simexplorer-ide/simexplorer-ide-ant/org.openmole.ui/src/org/openmole/ui/workflow/implementation/TaskCapsuleModelUI.java
r3135 r3142 22 22 nbSlots.put(IOType.OUTPUT, 0); 23 23 } 24 25 @Override 26 public void setName(String objectName) {} 27 28 @Override 29 public void objectChanged(IGenericTaskCapsule obj) { 30 System.out.println("The Task capsule" + obj + "has been modified"); 31 } 32 24 33 25 @Override 34 26 public int getNbInputslots(){ … … 67 59 } 68 60 61 @Override 62 public void objectChanged(T obj) { 63 throw new UnsupportedOperationException("Not supported yet."); 64 } 65 66 @Override 67 public void updateData() { 68 throw new UnsupportedOperationException("Not supported yet."); 69 } 70 69 71 } -
trunk/simexplorer-ide/simexplorer-ide-ant/org.openmole.ui/src/org/openmole/ui/workflow/implementation/TaskCapsuleViewUI.java
r3135 r3142 9 9 import org.netbeans.api.visual.layout.LayoutFactory; 10 10 import org.netbeans.api.visual.widget.Widget; 11 import org.openmole.ui.commons.ApplicationCustomize; 11 12 import org.openmole.ui.workflow.model.ITaskCapsuleModelUI; 12 13 import org.openmole.ui.workflow.model.ITaskCapsuleViewUI; … … 16 17 * @author mathieu 17 18 */ 18 public class TaskCapsuleViewUI <T> extends ObjectViewUI<T> implements ITaskCapsuleViewUI{19 public class TaskCapsuleViewUI extends ObjectViewUI implements ITaskCapsuleViewUI{ 19 20 20 21 private Widget inputSlotWidget; … … 22 23 private Widget widContainer; 23 24 private ITaskCapsuleModelUI model; 24 TaskCapsuleMenuProvider tmp;25 25 26 26 public TaskCapsuleViewUI(MoleScene sc) { 27 super(sc); 27 super(sc, 28 ApplicationCustomize.getInstance().getColor(ApplicationCustomize.TASK_BACKGROUND_COLOR), 29 ApplicationCustomize.getInstance().getColor(ApplicationCustomize.TASK_BORDER_COLOR)); 30 28 31 model = new TaskCapsuleModelUI(); 29 30 32 inputSlotWidget = TaskXXFactory.buildInputSlotWidget(scene); 31 33 outputSlotWidget = TaskXXFactory.buildOutputSlotWidget(scene); … … 36 38 addChild(widContainer); 37 39 38 39 tmp = new TaskCapsuleMenuProvider(inputSlotWidget, 40 outputSlotWidget, 41 sc, 42 model); 43 getActions().addAction(ActionFactory.createMoveAction()); 44 getActions().addAction(ActionFactory.createPopupMenuAction(tmp)); 45 getActions().addAction(ActionFactory.createMoveAction()); 40 getActions().addAction(ActionFactory.createPopupMenuAction(new TaskCapsuleMenuProvider(inputSlotWidget, 41 outputSlotWidget, 42 sc, 43 model))); 46 44 addInputSlot(); 47 45 addOutputSlot(); 48 }49 50 public TaskCapsuleMenuProvider getTaskCapsuleMenuProvider() {51 return tmp;52 }53 54 @Override55 public void setOutputSlotWidget(Widget wi) {56 outputSlotWidget = wi;57 }58 59 @Override60 public void setIntputSlotWidget(Widget wi) {61 inputSlotWidget = wi;62 }63 64 @Override65 public Widget getOutputSlotWidget() {66 return outputSlotWidget;67 }68 69 @Override70 public Widget getInputSlotWidget() {71 return inputSlotWidget;72 46 } 73 47 -
trunk/simexplorer-ide/simexplorer-ide-ant/org.openmole.ui/src/org/openmole/ui/workflow/implementation/TaskCompositeModelUI.java
r3135 r3142 13 13 * @author mathieu 14 14 */ 15 public class TaskCompositeModelUI extends ObjectModelUIimplements ITaskCapsuleModelUI, ITaskModelUI{15 public class TaskCompositeModelUI implements ITaskCapsuleModelUI, ITaskModelUI{ 16 16 17 17 ITaskModelUI<IGenericTask> tModel; … … 22 22 tModel = tm; 23 23 tcModel = tcm; 24 }25 26 27 @Override28 public void setName(String objectName) {29 tModel.setName(objectName);30 }31 32 @Override33 public void objectChanged(Object obj) {34 System.out.println("The object "+obj+" has been modified");35 24 } 36 25 … … 79 68 return tModel.getFields(); 80 69 } 70 71 @Override 72 public void setFields() { 73 tModel.setFields(); 74 } 75 76 @Override 77 public void objectChanged(Object t) { 78 throw new UnsupportedOperationException("Not supported yet."); 79 } 81 80 } -
trunk/simexplorer-ide/simexplorer-ide-ant/org.openmole.ui/src/org/openmole/ui/workflow/implementation/TaskCompositeViewUI.java
r3135 r3142 5 5 import org.netbeans.api.visual.layout.LayoutFactory; 6 6 import org.netbeans.api.visual.widget.Widget; 7 import org.openmole.ui.commons.ApplicationCustomize; 7 8 import org.openmole.ui.workflow.implementation.paint.IOParameterWidget; 8 9 import org.openmole.ui.workflow.model.IObjectModelUI; 10 import org.openmole.ui.workflow.model.ITaskModelUI; 11 import org.simexplorer.core.workflow.model.task.IGenericTask; 9 12 10 13 /** … … 14 17 public class TaskCompositeViewUI extends ObjectViewUI{ 15 18 16 private GenericMenuProvider gmp;17 19 Widget inputSlotWidget; 18 20 Widget outputSlotWidget; 21 19 22 TaskCapsuleModelUI taskCapsuleModel; 20 TaskModelUItaskModel;23 ITaskModelUI<IGenericTask> taskModel; 21 24 private IObjectModelUI model; 22 25 23 public TaskCompositeViewUI(MoleScene sc, 26 public TaskCompositeViewUI(MoleScene scene, 27 ITaskModelUI<IGenericTask> m, 24 28 String st){ 25 super(sc); 29 super(scene, 30 m, 31 ApplicationCustomize.getInstance().getColor(ApplicationCustomize.TASK_BACKGROUND_COLOR), 32 ApplicationCustomize.getInstance().getColor(ApplicationCustomize.TASK_BORDER_COLOR)); 33 34 taskModel = m; 35 taskCapsuleModel = new TaskCapsuleModelUI(); 26 36 27 37 inputSlotWidget = TaskXXFactory.buildInputSlotWidget(scene); … … 41 51 42 52 setLayout(LayoutFactory.createOverlayLayout()); 53 54 43 55 addChild(TaskXXFactory.getTaskView(scene, 44 56 in, 45 57 out, 58 pWidget, 46 59 st)); 47 60 48 taskModel = new TaskModelUI();49 taskCapsuleModel = new TaskCapsuleModelUI();50 61 model = new TaskCompositeModelUI(taskModel,taskCapsuleModel); 51 62 … … 58 69 taskCapsuleModel); 59 70 60 gmp = PopupMenuProviderFactory.merge(new TaskMenuProvider(taskModel),71 GenericMenuProvider gmp = PopupMenuProviderFactory.merge(new TaskMenuProvider(taskModel), 61 72 new TaskCapsuleMenuProvider(inputSlotWidget, 62 73 outputSlotWidget, … … 64 75 taskCapsuleModel), 65 76 model); 66 77 67 78 getActions().addAction(ActionFactory.createPopupMenuAction(gmp)); 68 getActions ().addAction (new TaskActions(taskModel));69 getActions().addAction(ActionFactory.createMoveAction());70 79 } 71 80 } -
trunk/simexplorer-ide/simexplorer-ide-ant/org.openmole.ui/src/org/openmole/ui/workflow/implementation/TaskModelUI.java
r3135 r3142 5 5 import org.openmole.ui.control.TableType; 6 6 import org.openmole.ui.control.TableType.Name; 7 import org.openmole.ui.workflow.model.IObjectModelUI; 7 8 import org.openmole.ui.workflow.model.ITaskModelUI; 8 9 import org.simexplorer.core.workflow.model.task.IGenericTask; … … 14 15 public class TaskModelUI<T extends IGenericTask> implements ITaskModelUI<T> { 15 16 16 IGenericTask task; 17 Collection<TableType.Name> fields = new ArrayList<TableType.Name>(); 18 19 public TaskModelUI() { 20 fields.add(Name.INPUT_PARAMETER); 21 fields.add(Name.OUTPUT_PARAMETER); 22 } 23 String name; 17 private IGenericTask task; 18 protected transient Collection<TableType.Name> fields; 24 19 25 20 @Override … … 29 24 30 25 @Override 31 public void setName(String tName) { 32 name = tName; 26 public void updateData() { 33 27 } 34 28 35 @Override 36 public void updateData() { 37 System.out.println("Update data "); 29 public synchronized void setFields() { 30 if (fields == null) { 31 fields = new ArrayList<TableType.Name>(); 32 fields.add(Name.INPUT_PARAMETER); 33 fields.add(Name.OUTPUT_PARAMETER); 34 } 38 35 } 39 36 40 37 @Override 41 38 public Collection<TableType.Name> getFields() { 39 setFields(); 42 40 return fields; 43 41 } -
trunk/simexplorer-ide/simexplorer-ide-ant/org.openmole.ui/src/org/openmole/ui/workflow/implementation/TaskViewUI.java
r3135 r3142 5 5 package org.openmole.ui.workflow.implementation; 6 6 7 import java.awt.Color; 7 8 import org.netbeans.api.visual.action.ActionFactory; 8 import org.netbeans.api.visual.widget.*; 9 import org.openmole.ui.commons.ApplicationCustomize; 10 import org.openmole.ui.workflow.implementation.paint.PainterWidget; 9 11 import org.openmole.ui.workflow.model.ITaskModelUI; 10 12 import org.openmole.ui.workflow.model.ITaskViewUI; … … 14 16 * @author mathieu 15 17 */ 16 public class TaskViewUI<T> extends ObjectViewUI<T> implements ITaskViewUI { 18 //public class TaskViewUI extends ObjectViewUI implements ITaskViewUI { 19 public class TaskViewUI extends ObjectViewUI{ 17 20 18 21 protected ITaskModelUI model; 19 public static final int ARROW_PIN_WIDTH = 15;20 public static final int MARGIN_SE_ROUNDED_RECTANGLE = ARROW_PIN_WIDTH * 77 / 100;21 Widget taskWidget;22 22 23 23 public TaskViewUI(MoleScene sc, 24 String name) { 25 super(sc); 24 ITaskModelUI m, 25 String name) { 26 super(sc, 27 ApplicationCustomize.getInstance().getColor(ApplicationCustomize.TASK_BACKGROUND_COLOR), 28 ApplicationCustomize.getInstance().getColor(ApplicationCustomize.TASK_BORDER_COLOR)); 29 model = m; 26 30 27 31 addChild(TaskXXFactory.getTaskView(sc, 28 32 TaskXXFactory.buildInputParameterContainer(scene), 29 33 TaskXXFactory.buildOutputParameterContainer(scene), 34 pWidget, 30 35 name)); 31 getActions().addAction(ActionFactory.createMoveAction()); 32 33 model = new TaskModelUI(); 34 getActions().addAction(ActionFactory.createMoveAction()); 35 getActions().addAction(ActionFactory.createPopupMenuAction(new TaskMenuProvider(model))); 36 getActions().addAction(new TaskActions(model)); 36 // getActions().addAction(ActionFactory.createMoveAction()); 37 // getActions().addAction(ActionFactory.createPopupMenuAction(new TaskMenuProvider(model))); 38 getActions().addAction(new TaskActions(model,this)); 37 39 } 38 40 } -
trunk/simexplorer-ide/simexplorer-ide-ant/org.openmole.ui/src/org/openmole/ui/workflow/implementation/TaskXXFactory.java
r3135 r3142 1 1 package org.openmole.ui.workflow.implementation; 2 2 3 import java.awt.Color; 4 import org.openmole.ui.workflow.implementation.paint.ContainerUI; 3 5 import java.awt.Image; 4 6 import java.awt.Rectangle; 7 import javax.swing.BorderFactory; 5 8 import org.netbeans.api.visual.layout.LayoutFactory; 6 9 import org.netbeans.api.visual.model.StateModel; … … 10 13 import org.openmole.ui.workflow.implementation.paint.IOType; 11 14 import org.openmole.ui.commons.ApplicationCustomize; 15 import org.openmole.ui.workflow.implementation.paint.PainterWidget; 12 16 import org.openmole.ui.workflow.model.ITaskCapsuleModelUI; 13 17 … … 29 33 30 34 31 ApplicationCustomize colorCutomize = ApplicationCustomize.getInstance( null);35 ApplicationCustomize colorCutomize = ApplicationCustomize.getInstance(); 32 36 33 37 Widget selfContainer = BorderedWidgetFactory.getInstance().getBorderedWidget(scene, … … 69 73 70 74 public static void addOutputSlotToSlotWidget(Widget wi, 71 MoleScene scene,72 ITaskCapsuleModelUI model) {75 MoleScene scene, 76 ITaskCapsuleModelUI model) { 73 77 wi.addChild(new SlotWidget(scene, 74 IOType.OUTPUT,75 model));78 IOType.OUTPUT, 79 model)); 76 80 77 81 model.addOutputSlot(); 78 82 } 79 83 80 public static void addInputSlotToSlotWidget(Widget wi,81 MoleScene scene,82 ITaskCapsuleModelUI model) {84 public static void addInputSlotToSlotWidget(Widget wi, 85 MoleScene scene, 86 ITaskCapsuleModelUI model) { 83 87 wi.addChild(new SlotWidget(scene, 84 IOType.INPUT,85 model));88 IOType.INPUT, 89 model)); 86 90 87 91 model.addInputSlot(); … … 99 103 IOType type, 100 104 Widget container) { 101 ApplicationCustomize colorCutomize = ApplicationCustomize.getInstance( null);102 Rectangle labBounds = new Rectangle(0, 0, ApplicationCustomize.TASK_CONTAINER_WIDTH / 3 , ApplicationCustomize.TASK_TITLE_HEIGHT);105 ApplicationCustomize colorCutomize = ApplicationCustomize.getInstance(); 106 Rectangle labBounds = new Rectangle(0, 0, ApplicationCustomize.TASK_CONTAINER_WIDTH / 3 - 2, ApplicationCustomize.TASK_TITLE_HEIGHT - 2); 103 107 Image img = (type == IOType.INPUT ? ApplicationCustomize.IMAGE_INPUT_ARROW : ApplicationCustomize.IMAGE_OUTPUT_ARROW); 104 108 … … 107 111 ExpandControler controlerWidget = new ExpandControler(scene, 108 112 stateModel, 109 labBounds,110 113 img, 111 114 img); … … 121 124 labelContainer.setLayout(LayoutFactory.createVerticalFlowLayout()); 122 125 labelContainer.addWidget(controlerWidget, 0); 123 labelContainer.setBounds(labBounds);124 126 // labelContainer.setBounds(labBounds); 127 // labelContainer.setBorder(BorderFactory.createLineBorder(Color.blue)); 125 128 return labelContainer; 126 129 } … … 133 136 ExpandControler titleControlerWidget = new ExpandControler(scene, 134 137 titleStateModel, 135 titleBounds,136 138 ApplicationCustomize.IMAGE_EXPAND, 137 139 ApplicationCustomize.IMAGE_COLLAPSE, … … 141 143 ExpandableContainerUI titleContainer = new ExpandableContainerUI(scene, 142 144 titleBounds, 143 ApplicationCustomize.getInstance( null).getColor(ApplicationCustomize.TASK_HEADER_BACKGROUND_COLOR),144 ApplicationCustomize.getInstance( null).getColor(ApplicationCustomize.TASK_HEADER_BACKGROUND_COLOR),145 ApplicationCustomize.getInstance().getColor(ApplicationCustomize.TASK_HEADER_BACKGROUND_COLOR), 146 ApplicationCustomize.getInstance().getColor(ApplicationCustomize.TASK_HEADER_BACKGROUND_COLOR), 145 147 titleControlerWidget, 146 148 titleStateModel, … … 159 161 ExpandableContainerUI outputLabelContainer) { 160 162 161 ApplicationCustomize colorCutomize = ApplicationCustomize.getInstance( null);162 Rectangle labBounds = new Rectangle(0, 0, ApplicationCustomize.TASK_CONTAINER_WIDTH / 3 , ApplicationCustomize.TASK_TITLE_HEIGHT);163 ApplicationCustomize colorCutomize = ApplicationCustomize.getInstance(); 164 Rectangle labBounds = new Rectangle(0, 0, ApplicationCustomize.TASK_CONTAINER_WIDTH / 3 - 2, ApplicationCustomize.TASK_TITLE_HEIGHT - 2); 163 165 Rectangle titleBounds = new Rectangle(0, 0, ApplicationCustomize.TASK_TITLE_WIDTH, ApplicationCustomize.TASK_TITLE_HEIGHT); 164 166 … … 180 182 181 183 public static Widget getTaskView(MoleScene scene, 182 IOParameterWidget inputParameterContainer, 183 IOParameterWidget outputParameterContainer, 184 String name){ 185 ExpandableContainerUI inputLabelContainer; 186 ExpandableContainerUI outputLabelContainer; 187 ExpandableContainerUI titleContainer; 188 ApplicationCustomize colorCutomize = ApplicationCustomize.getInstance(null); 184 IOParameterWidget inputParameterContainer, 185 IOParameterWidget outputParameterContainer, 186 PainterWidget selfContainer, 187 String name) { 188 ExpandableContainerUI inputLabelContainer; 189 ExpandableContainerUI outputLabelContainer; 190 ExpandableContainerUI titleContainer; 191 ApplicationCustomize colorCutomize = ApplicationCustomize.getInstance(); 189 192 190 193 inputLabelContainer = TaskXXFactory.buildIOControler(scene, … … 197 200 inputLabelContainer, 198 201 outputLabelContainer); 199 200 Rectangle taskBounds = new Rectangle(ApplicationCustomize.TASK_INPUT_WIDTH, 0, ApplicationCustomize.TASK_CONTAINER_WIDTH, ApplicationCustomize.TASK_CONTAINER_HEIGHT); 201 Rectangle capsuleBounds = new Rectangle(0, 202 0, 203 ApplicationCustomize.TASK_CONTAINER_WIDTH, 204 ApplicationCustomize.TASK_CONTAINER_HEIGHT + ApplicationCustomize.TASK_TITLE_HEIGHT); 205 206 ContainerUI taskContainer = new ContainerUI(scene, 207 taskBounds, 208 colorCutomize.getColor(ApplicationCustomize.TRANSPARENT_COLOR), 209 colorCutomize.getColor(ApplicationCustomize.TRANSPARENT_COLOR)); 210 211 Widget selfContainer = BorderedWidgetFactory.getInstance().getBorderedWidget(scene, 212 capsuleBounds, 213 colorCutomize.getColor(ApplicationCustomize.TASK_BACKGROUND_COLOR), 214 colorCutomize.getColor(ApplicationCustomize.TASK_BORDER_COLOR), 215 false); 202 Rectangle taskBounds = new Rectangle(0, 0, ApplicationCustomize.TASK_CONTAINER_WIDTH, ApplicationCustomize.TASK_CONTAINER_HEIGHT); 203 204 Widget emptyWi = new Widget(scene); 205 emptyWi.setPreferredBounds(taskBounds); 216 206 217 207 selfContainer.setLayout(LayoutFactory.createVerticalFlowLayout()); 218 selfContainer.addChild( taskContainer);208 selfContainer.addChild(emptyWi); 219 209 selfContainer.addChild(IOContainer); 220 210 … … 224 214 outputParameterContainer.getContainer()); 225 215 titleContainer.setName(name); 226 216 227 217 Widget midWidget = new Widget(scene); 228 218 midWidget.setLayout(LayoutFactory.createVerticalFlowLayout()); … … 237 227 taskWidget.addChild(outputParameterContainer); 238 228 return taskWidget; 239 } 240 241 229 } 230 231 232 public static PainterWidget getSelfContainer(MoleScene scene) { 233 ApplicationCustomize colorCutomize = ApplicationCustomize.getInstance(); 234 Rectangle capsuleBounds = new Rectangle(0, 235 0, 236 ApplicationCustomize.TASK_CONTAINER_WIDTH, 237 ApplicationCustomize.TASK_CONTAINER_HEIGHT + ApplicationCustomize.TASK_TITLE_HEIGHT); 238 239 return BorderedWidgetFactory.getInstance().getBorderedWidget(scene, 240 capsuleBounds, 241 colorCutomize.getColor(ApplicationCustomize.TASK_BACKGROUND_COLOR), 242 colorCutomize.getColor(ApplicationCustomize.TASK_BORDER_COLOR), 243 false); 244 245 } 242 246 243 247 public static TaskXXFactory getInstance() { -
trunk/simexplorer-ide/simexplorer-ide-ant/org.openmole.ui/src/org/openmole/ui/workflow/implementation/UIFactory.java
r3099 r3142 10 10 import java.util.HashMap; 11 11 import java.util.Map; 12 import org.openmole.ui.workflow.model.IObject ViewUI;12 import org.openmole.ui.workflow.model.IObjectModelUI; 13 13 import org.openmole.ui.workflow.model.IUIFactory; 14 14 import org.simexplorer.core.commons.tools.Instanciator; 15 import org.simexplorer.core.workflow.implementation.capsule.GenericTaskCapsule;16 15 import org.simexplorer.core.workflow.model.task.ITask; 17 16 import org.simexplorer.core.workflow.methods.task.*; 18 import org.simexplorer.core.workflow. model.capsule.ITaskCapsule;17 import org.simexplorer.core.workflow.implementation.task.ExplorationTask; 19 18 20 19 /** … … 27 26 28 27 private static UIFactory instance = null; 29 Map<Class<?>, Class<? extends IObjectViewUI>> businessToUIMap = new HashMap();30 28 31 public UIFactory() {32 // ServiceProxy.getEventDispatcher().registerListner(IJob.class,this); 33 // ServiceProxy.getEventDispatcher().registerListner(IGenericTask.class,this);29 Map<Class<?>, Class<? extends IObjectModelUI>> businessToUIMap = new HashMap<Class<?>, Class<? extends IObjectModelUI>>(); 30 31 /* public UIFactory() { 34 32 setHashMap(); 35 33 } 36 34 37 private <T> void add(Class<? extends T> business, Class<? extends IObject ViewUI> visualisation) {35 private <T> void add(Class<? extends T> business, Class<? extends IObjectModelUI> visualisation) { 38 36 businessToUIMap.put(business, visualisation); 39 } 37 }*/ 40 38 41 39 /** … … 43 41 * Stub: to be changed by a config file reading mechanism 44 42 */ 45 private void setHashMap() { 46 add(GroovyTask.class, TaskViewUI.class); 47 add(ITask.class, TaskViewUI.class); 48 add(JavaTask.class, TaskViewUI.class); 49 // add(ITaskCapsule.class,TaskCapsuleViewUI.class); 50 // add(GenericTaskCapsule.class,TaskCapsuleViewUI.class); 43 /* private void setHashMap() { 44 //add(GroovyTask.class, TaskViewUI.class); 45 //add(ITask.class, TaskViewUI.class); 46 //add(JavaTask.class, TaskViewUI.class); 47 add(GroovyTask.class, TaskModelUI.class); 48 add(ITask.class, TaskModelUI.class); 49 add(JavaTask.class, TaskModelUI.class); 50 add(ExplorationTask.class, ExplorationTaskModelUI.class); 51 51 52 } 52 }*/ 53 53 54 54 @Override 55 public <T> IObject ViewUI create(T obj, MoleScene scene) {55 public <T> IObjectModelUI create(T obj) { 56 56 Class superClass = obj.getClass(); 57 57 58 58 while (superClass != Object.class) { 59 if (businessToUIMap.containsKey(superClass)) { 59 // if (businessToUIMap.containsKey(superClass)) { 60 if (Preferences.getInstance().containsBusinessKey(superClass)) { 60 61 try { 61 return Instanciator.instanciate(businessToUIMap.get(superClass),scene); 62 // return Instanciator.instanciate(businessToUIMap.get(superClass)); 63 return Instanciator.instanciate(Preferences.getInstance().getModelClass(superClass)); 62 64 } catch (IllegalArgumentException illE) { 63 65 MoleExceptionManagement.showException(illE); -
trunk/simexplorer-ide/simexplorer-ide-ant/org.openmole.ui/src/org/openmole/ui/workflow/implementation/paint/BorderedRectangularPainter.java
r2914 r3142 86 86 bounds.height); 87 87 } 88 88 89 89 if (provider.getBackgroundColor() != null) { 90 90 graphics.setColor(provider.getBackgroundColor()); -
trunk/simexplorer-ide/simexplorer-ide-ant/org.openmole.ui/src/org/openmole/ui/workflow/implementation/paint/BorderedRectangularProvider.java
r2972 r3142 15 15 * along with this program. If not, see <http://www.gnu.org/licenses/>. 16 16 */ 17 18 17 package org.openmole.ui.workflow.implementation.paint; 19 18 … … 25 24 * @author mathieu 26 25 */ 27 public class BorderedRectangularProvider implements IBorderedRectangularProvider {26 public class BorderedRectangularProvider implements IBorderedRectangularProvider { 28 27 29 28 public static final int ARROW_PIN_WIDTH = 15; 30 // public static final int MARGIN_SE_ROUNDED_RECTANGLE = ARROW_PIN_WIDTH * 77 / 100;29 // public static final int MARGIN_SE_ROUNDED_RECTANGLE = ARROW_PIN_WIDTH * 77 / 100; 31 30 public static final int MARGIN_SE_ROUNDED_RECTANGLE = -1; 32 33 31 private Rectangle clipRect; 34 32 private Color backgroundColor; … … 37 35 boolean roundBorder; 38 36 39 public BorderedRectangularProvider(Rectangle rArea, Color baColor, Color boColor, boolean rBorder) {37 public BorderedRectangularProvider(Rectangle rArea, Color baColor, Color boColor, boolean rBorder) { 40 38 backgroundColor = baColor; 41 39 borderColor = boColor; … … 46 44 @Override 47 45 public Color getBorderColor() { 48 return borderColor;46 return borderColor; 49 47 } 50 48 51 49 @Override 52 50 public Color getBackgroundColor() { 53 return backgroundColor; 51 return backgroundColor; 52 } 53 54 @Override 55 public void setBackgroundColor(Color col) { 56 57 backgroundColor = col; 58 } 59 60 @Override 61 public void setBorderColor(Color col) { 62 borderColor = col; 54 63 } 55 64 … … 61 70 @Override 62 71 public Rectangle getClipRect() { 63 // Rectangle clientArea = containerWidget.getClientArea();64 Rectangle gradientRect = new Rectangle();72 // Rectangle clientArea = containerWidget.getClientArea(); 73 Rectangle gradientRect = new Rectangle(); 65 74 66 gradientRect.x = clientArea.x + MARGIN_SE_ROUNDED_RECTANGLE;67 gradientRect.y = clientArea.y;68 gradientRect.width = clientArea.width - MARGIN_SE_ROUNDED_RECTANGLE - MARGIN_SE_ROUNDED_RECTANGLE;69 gradientRect.height = clientArea.height;75 gradientRect.x = clientArea.x + MARGIN_SE_ROUNDED_RECTANGLE; 76 gradientRect.y = clientArea.y; 77 gradientRect.width = clientArea.width - MARGIN_SE_ROUNDED_RECTANGLE - MARGIN_SE_ROUNDED_RECTANGLE; 78 gradientRect.height = clientArea.height; 70 79 71 clipRect = gradientRect;72 return gradientRect;73 }80 clipRect = gradientRect; 81 return gradientRect; 82 } 74 83 75 public Rectangle getClientArea() {84 public Rectangle getClientArea() { 76 85 return clientArea; 77 86 } 78 79 } 87 } -
trunk/simexplorer-ide/simexplorer-ide-ant/org.openmole.ui/src/org/openmole/ui/workflow/implementation/paint/BorderedWidgetFactory.java
r2982 r3142 20 20 import java.awt.Graphics2D; 21 21 import java.awt.Rectangle; 22 import org.netbeans.api.visual.layout.LayoutFactory;23 import org.netbeans.api.visual.widget.Widget;24 22 import org.openmole.ui.workflow.implementation.MoleScene; 25 23 … … 29 27 */ 30 28 public class BorderedWidgetFactory { 31 Widget containerWidget;29 PainterWidget containerWidget; 32 30 private static BorderedWidgetFactory instance = null; 33 31 34 32 // private static final int PIN_VERTICAL_GAP = 5; 35 33 36 public Widget getBorderedWidget(MoleScene scene, Rectangle rArea,Color baColor, Color boColor, boolean roundBorder) {34 public PainterWidget getBorderedWidget(MoleScene scene, Rectangle rArea,Color baColor, Color boColor, boolean roundBorder) { 37 35 38 36 final BorderedRectangularProvider provider = new BorderedRectangularProvider(rArea, baColor, boColor, roundBorder); -
trunk/simexplorer-ide/simexplorer-ide-ant/org.openmole.ui/src/org/openmole/ui/workflow/implementation/paint/ContainerUI.java
r3088 r3142 3 3 * and open the template in the editor. 4 4 */ 5 package org.openmole.ui.workflow.implementation ;5 package org.openmole.ui.workflow.implementation.paint; 6 6 7 7 import java.awt.Color; 8 8 import java.awt.Rectangle; 9 9 import org.netbeans.api.visual.widget.Widget; 10 import org.openmole.ui.workflow.implementation. paint.BorderedWidgetFactory;10 import org.openmole.ui.workflow.implementation.MoleScene; 11 11 import org.openmole.ui.workflow.model.IContainerUI; 12 12 … … 17 17 public class ContainerUI extends Widget implements IContainerUI{ 18 18 19 protected Widget containerWidget;19 protected PainterWidget containerWidget; 20 20 21 21 public ContainerUI(MoleScene scene, Rectangle clientArea, Color baColor, Color boColor) { -
trunk/simexplorer-ide/simexplorer-ide-ant/org.openmole.ui/src/org/openmole/ui/workflow/implementation/paint/IBorderedRectangularProvider.java
r2915 r3142 54 54 //Rectangle getHeaderRect(); 55 55 //Color getHeaderColor(); 56 Color getBorderColor(); 57 Color getBackgroundColor(); 58 boolean isRounded(); 59 Rectangle getClipRect(); 56 public Color getBorderColor(); 57 public Color getBackgroundColor(); 58 public void setBackgroundColor(Color col); 59 public void setBorderColor(Color col); 60 61 public boolean isRounded(); 62 public Rectangle getClipRect(); 60 63 61 64 } -
trunk/simexplorer-ide/simexplorer-ide-ant/org.openmole.ui/src/org/openmole/ui/workflow/implementation/paint/IOParameterWidget.java
r3132 r3142 8 8 import org.netbeans.api.visual.layout.LayoutFactory; 9 9 import org.netbeans.api.visual.widget.Widget; 10 import org.openmole.ui.workflow.implementation.ContainerUI;11 10 import org.openmole.ui.workflow.implementation.MoleScene; 12 11 … … 25 24 scene = sc; 26 25 27 ApplicationCustomize colorCutomize = ApplicationCustomize.getInstance( null);26 ApplicationCustomize colorCutomize = ApplicationCustomize.getInstance(); 28 27 29 28 Rectangle bounds = new Rectangle(type == IOType.INPUT ? 0 : 2, -
trunk/simexplorer-ide/simexplorer-ide-ant/org.openmole.ui/src/org/openmole/ui/workflow/implementation/paint/PainterWidget.java
r2897 r3142 42 42 package org.openmole.ui.workflow.implementation.paint; 43 43 44 import java.awt.Color; 44 45 import org.netbeans.api.visual.widget.Scene; 45 46 import org.netbeans.api.visual.widget.Widget; … … 59 60 } 60 61 62 public void setBackgroundColor(Color col){ 63 mPainter.getProvider().setBackgroundColor(col); 64 } 65 66 public void setBorderColor(Color col){ 67 mPainter.getProvider().setBorderColor(col); 68 } 69 70 @Override 61 71 protected void paintWidget () { 62 72 super.paintWidget(); -
trunk/simexplorer-ide/simexplorer-ide-ant/org.openmole.ui/src/org/openmole/ui/workflow/model/IContainerUI.java
r2930 r3142 18 18 package org.openmole.ui.workflow.model; 19 19 20 import java.awt.Rectangle;21 20 import org.netbeans.api.visual.widget.Widget; 22 21 -
trunk/simexplorer-ide/simexplorer-ide-ant/org.openmole.ui/src/org/openmole/ui/workflow/model/IJobModelUI.java
r3090 r3142 12 12 * @author mathieu 13 13 */ 14 public interface IJobModelUI <T extends IJob> extends IObjectModelUI<T>{14 public interface IJobModelUI <T extends IJob> { 15 15 } -
trunk/simexplorer-ide/simexplorer-ide-ant/org.openmole.ui/src/org/openmole/ui/workflow/model/IObjectModelUI.java
r3091 r3142 2 2 package org.openmole.ui.workflow.model; 3 3 4 import java.util.Collection; 5 import org.openmole.ui.control.TableType; 4 6 import org.simexplorer.core.commons.eventdispatcher.IObjectChangedAsynchronousListener; 7 import org.simexplorer.core.workflow.model.task.IGenericTask; 5 8 6 9 /** … … 9 12 */ 10 13 public interface IObjectModelUI <T> extends IObjectChangedAsynchronousListener<T>{ 11 12 //Class<? extends T> getVisualised();13 //VisualizationRank getRank();14 public void setName(String objectName);15 14 @Override 16 15 public void objectChanged(T obj); 16 public void updateData(); 17 17 } -
trunk/simexplorer-ide/simexplorer-ide-ant/org.openmole.ui/src/org/openmole/ui/workflow/model/IObjectViewUI.java
r3136 r3142 1 1 package org.openmole.ui.workflow.model; 2 2 3 import java x.swing.JTabbedPane;3 import java.awt.Color; 4 4 5 5 /** … … 7 7 * @author mathieu 8 8 */ 9 public interface IObjectViewUI<T>{ 9 public interface IObjectViewUI{ 10 11 public void setBackgroundColor(Color col); 12 public void setBorderColor(Color col); 13 public void setDefaultBackgroundColor(); 14 public void setDefaultBorderColor(); 10 15 //public void initialize(String name); 11 16 //public JTabbedPane getTableTabbed(); -
trunk/simexplorer-ide/simexplorer-ide-ant/org.openmole.ui/src/org/openmole/ui/workflow/model/ITaskCapsuleModelUI.java
r3101 r3142 12 12 * @author mathieu 13 13 */ 14 //public interface ITaskCapsuleModelUI<T extends IGenericTaskCapsule> extends IObjectModelUI<T>, ITaskXXModelUI {15 14 public interface ITaskCapsuleModelUI<T extends IGenericTaskCapsule> extends IObjectModelUI<T> { 16 15 public void addOutputSlot(); -
trunk/simexplorer-ide/simexplorer-ide-ant/org.openmole.ui/src/org/openmole/ui/workflow/model/ITaskCapsuleViewUI.java
r3136 r3142 1 1 package org.openmole.ui.workflow.model; 2 3 import java.awt.event.ActionListener;4 import org.netbeans.api.visual.widget.Widget;5 import org.simexplorer.core.workflow.model.capsule.IGenericTaskCapsule;6 2 7 3 /** … … 9 5 * @author mathieu 10 6 */ 11 public interface ITaskCapsuleViewUI<T extends IGenericTaskCapsule> extends IObjectViewUI{ 12 13 // public ITaskCapsuleModelUI getTaskCapsuleModel(); 14 // public ITaskCapsuleModelUI<T> getModel(); 15 // public ActionListener getInputAction(); 16 // public ActionListener getOutputAction(); 17 public void setIntputSlotWidget(Widget wi); 18 public void setOutputSlotWidget(Widget wi); 19 public Widget getInputSlotWidget(); 20 public Widget getOutputSlotWidget(); 21 // public void addInputSlot(); 22 // public void addOutputSlot(); 23 } 7 public interface ITaskCapsuleViewUI extends IObjectViewUI{} -
trunk/simexplorer-ide/simexplorer-ide-ant/org.openmole.ui/src/org/openmole/ui/workflow/model/ITaskModelUI.java
r3136 r3142 16 16 public void updateData(); 17 17 public Collection<TableType.Name> getFields(); 18 public void setFields(); 18 19 } -
trunk/simexplorer-ide/simexplorer-ide-ant/org.openmole.ui/src/org/openmole/ui/workflow/model/ITaskViewUI.java
r3136 r3142 1 1 package org.openmole.ui.workflow.model; 2 2 3 import java.util.Collection; 4 import org.netbeans.api.visual.widget.Widget; 5 import org.openmole.ui.control.model.ITableView; 6 import org.simexplorer.core.workflow.model.task.IGenericTask; 3 import java.awt.Color; 7 4 8 5 /** … … 10 7 * @author mathieu 11 8 */ 12 public interface ITaskViewUI<T extends IGenericTask> extends IObjectViewUI<T> { 13 //public interface ITaskViewUI<T extends IGenericTask> { 14 15 // public void initialize(String na, IGenericTask genTask); 16 // public ITaskModelUI getTaskModel(); 17 // public void setName(String s); 18 // public Widget getWidget(); 19 // public Widget getInputParameterContainer(); 20 // public Widget getOutputParameterContainer(); 21 // public Collection<ITableView> getAssociatedTables() throws IllegalAccessException; 22 } 9 public interface ITaskViewUI extends IObjectViewUI{} -
trunk/simexplorer-ide/simexplorer-ide-ant/org.openmole.ui/src/org/openmole/ui/workflow/model/IUIFactory.java
r3101 r3142 6 6 package org.openmole.ui.workflow.model; 7 7 8 import org.openmole.ui.workflow.implementation.MoleScene;9 8 import org.simexplorer.core.commons.eventdispatcher.IObjectConstructedAsynchronousListener; 10 9 … … 15 14 public interface IUIFactory<T> extends IObjectConstructedAsynchronousListener<T> { 16 15 17 <T> IObject ViewUI create(T obj,MoleScene scene);16 <T> IObjectModelUI create(T obj); 18 17 19 18 }





