Math2mat
|
00001 00015 package m2m.frontend.dynamicview.figure; 00016 00017 import m2m.frontend.dynamicview.model.*; 00018 00019 import org.eclipse.draw2d.ColorConstants; 00020 import org.eclipse.draw2d.Figure; 00021 import org.eclipse.draw2d.Label; 00022 import org.eclipse.draw2d.ToolbarLayout; 00023 import org.eclipse.draw2d.XYLayout; 00024 import org.eclipse.draw2d.geometry.Rectangle; 00025 00026 00027 public class FunctionPropertyFigure extends Figure 00028 { 00032 private XYLayout layout; 00036 private Label labelName = new Label(); 00037 00038 00042 public FunctionPropertyFigure() 00043 { 00044 /* Set the type of layout */ 00045 layout = new XYLayout(); 00046 setLayoutManager(layout); 00047 00048 /* Initialisation of the label */ 00049 labelName.setForegroundColor(ColorConstants.black); 00050 add(labelName, ToolbarLayout.VERTICAL); 00051 setConstraint(labelName, new Rectangle(0, 0, -1, -1)); 00052 labelName.setText("Unknown"); 00053 00054 /* Initialisation of the figure */ 00055 setOpaque(true); 00056 setBackgroundColor(ColorConstants.menuBackground); 00057 setForegroundColor(ColorConstants.menuForeground); 00058 } 00059 00060 00065 public void setProperty(GraphicFunction graphicfunction) 00066 { 00067 labelName.setText("Name : " + graphicfunction.getName()); 00068 } 00069 } 00070