本文整理汇总了Java中org.eclipse.gef.GraphicalEditPart.getModel方法的典型用法代码示例。如果您正苦于以下问题:Java GraphicalEditPart.getModel方法的具体用法?Java GraphicalEditPart.getModel怎么用?Java GraphicalEditPart.getModel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.gef.GraphicalEditPart
的用法示例。
在下文中一共展示了GraphicalEditPart.getModel方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createCommand
import org.eclipse.gef.GraphicalEditPart; //导入方法依赖的package包/类
private Command createCommand(final List objects, final RGB rgb) {
if (objects.isEmpty()) {
return null;
}
if (!(objects.get(0) instanceof GraphicalEditPart)) {
return null;
}
final CompoundCommand command = new CompoundCommand();
for (int i = 0; i < objects.size(); i++) {
final GraphicalEditPart part = (GraphicalEditPart) objects.get(i);
final Object modelObject = part.getModel();
if (modelObject instanceof ViewableModel) {
command.add(new ChangeBackgroundColorCommand((ViewableModel) modelObject, rgb.red, rgb.green, rgb.blue));
} else if (modelObject instanceof ConnectionElement) {
command.add(new ChangeConnectionColorCommand((ConnectionElement) modelObject, rgb.red, rgb.green, rgb.blue));
}
}
return command;
}
示例2: createCommand
import org.eclipse.gef.GraphicalEditPart; //导入方法依赖的package包/类
private Command createCommand(List objects, RGB rgb) {
if (objects.isEmpty()) {
return null;
}
if (!(objects.get(0) instanceof GraphicalEditPart)) {
return null;
}
CompoundCommand command = new CompoundCommand();
for (int i = 0; i < objects.size(); i++) {
GraphicalEditPart part = (GraphicalEditPart) objects.get(i);
Object modelObject = part.getModel();
if (modelObject instanceof ViewableModel) {
command.add(new ChangeBackgroundColorCommand(
(ViewableModel) modelObject, rgb.red, rgb.green,
rgb.blue));
} else if (modelObject instanceof ConnectionElement) {
command.add(new ChangeConnectionColorCommand(
(ConnectionElement) modelObject, rgb.red, rgb.green,
rgb.blue));
}
}
return command;
}
示例3: DirectEditorManager
import org.eclipse.gef.GraphicalEditPart; //导入方法依赖的package包/类
/**
* @param source
* @param editorType
* @param locator
*/
@SuppressWarnings("unchecked")
public DirectEditorManager(GraphicalEditPart source, java.lang.Class editorType, CellEditorLocator locator,
String stringValue) {
super(source, editorType, locator);
if (source.getModel() instanceof NotationNode) {
model = (NotationNode) source.getModel();
} else if (source.getModel() instanceof LabelNode) {
model = (LabelNode) source.getModel();
}
this.stringValue = stringValue;
this.editPart = source;
}
示例4: LifeLineDirectEditorManager
import org.eclipse.gef.GraphicalEditPart; //导入方法依赖的package包/类
/**
* @param source
* @param editorType
* @param locator
*/
@SuppressWarnings("unchecked")
public LifeLineDirectEditorManager(GraphicalEditPart source, Class editorType, CellEditorLocator locator) {
super(source, editorType, locator);
model = (NotationNode) source.getModel();
}
示例5: NoteEditManager
import org.eclipse.gef.GraphicalEditPart; //导入方法依赖的package包/类
public NoteEditManager(final GraphicalEditPart source, final Class editorType, final CellEditorLocator locator) {
super(source, editorType, locator);
note = (Note) source.getModel();
}
示例6: NoteEditManager
import org.eclipse.gef.GraphicalEditPart; //导入方法依赖的package包/类
public NoteEditManager(GraphicalEditPart source, Class editorType,
CellEditorLocator locator) {
super(source, editorType, locator);
this.note = (Note) source.getModel();
}
示例7: NodeLabelDirectEditorManager
import org.eclipse.gef.GraphicalEditPart; //导入方法依赖的package包/类
/**
* @param source
* @param editorType
* @param locator
*/
@SuppressWarnings("unchecked")
public NodeLabelDirectEditorManager(GraphicalEditPart source, Class editorType, CellEditorLocator locator) {
super(source, editorType, locator);
model = (AbstractNode) source.getModel();
}
示例8: WalkerNoteEditManager
import org.eclipse.gef.GraphicalEditPart; //导入方法依赖的package包/类
public WalkerNoteEditManager(GraphicalEditPart source, Class<?> editorType, CellEditorLocator locator) {
super(source, editorType, locator);
this.note = (WalkerNote) source.getModel();
}
示例9: isMarqueeSelectable
import org.eclipse.gef.GraphicalEditPart; //导入方法依赖的package包/类
/**
* Decides whether the given edit part may potentially be included in the current marquee selection.
*
* @param editPart
* the {@link EditPart} of interest
* @return <code>true</code> if the given edit part may be included into the marquee selection, <code>false</code>
* otherwise
*/
protected boolean isMarqueeSelectable(GraphicalEditPart editPart) {
return editPart.isSelectable() && FigureUtilities.isNotFullyClipped(editPart.getFigure()) && editPart.getModel() instanceof MGraphicElement;
}