本文整理匯總了Java中org.eclipse.gef.EditPart.getChildren方法的典型用法代碼示例。如果您正苦於以下問題:Java EditPart.getChildren方法的具體用法?Java EditPart.getChildren怎麽用?Java EditPart.getChildren使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.gef.EditPart
的用法示例。
在下文中一共展示了EditPart.getChildren方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: checkWatcher
import org.eclipse.gef.EditPart; //導入方法依賴的package包/類
/**
* Return true if watch point enable otherwise false
*
* @return boolean
*/
public boolean checkWatcher(Component selectedComponent, String portName) {
ELTGraphicalEditor editor = (ELTGraphicalEditor) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
.getActiveEditor();
GraphicalViewer graphicalViewer = (GraphicalViewer) ((GraphicalEditor) editor).getAdapter(GraphicalViewer.class);
for (Iterator<EditPart> iterator = graphicalViewer.getEditPartRegistry().values().iterator(); iterator.hasNext();) {
EditPart editPart = iterator.next();
if (editPart instanceof ComponentEditPart) {
Component comp = ((ComponentEditPart) editPart).getCastedModel();
if (comp.equals(selectedComponent)) {
List<PortEditPart> portEditParts = editPart.getChildren();
for (AbstractGraphicalEditPart part : portEditParts) {
if (part instanceof PortEditPart) {
String port_Name = ((PortEditPart) part).getCastedModel().getTerminal();
if (port_Name.equals(portName)) {
return ((PortEditPart) part).getPortFigure().isWatched();
}
}
}
}
}
}
return false;
}
示例2: removeWatch
import org.eclipse.gef.EditPart; //導入方法依賴的package包/類
private void removeWatch(Port sourcePort, Component sourceComponent){
ELTGraphicalEditor editor=(ELTGraphicalEditor) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
GraphicalViewer graphicalViewer =(GraphicalViewer) ((GraphicalEditor)editor).getAdapter(GraphicalViewer.class);
for (Object objectEditPart : graphicalViewer.getEditPartRegistry().values())
{
EditPart editPart = (EditPart) objectEditPart;
if(editPart instanceof ComponentEditPart)
{
Component comp = ((ComponentEditPart)editPart).getCastedModel();
if(comp.equals(sourceComponent)){
List<PortEditPart> portEditParts = editPart.getChildren();
for(AbstractGraphicalEditPart part:portEditParts)
{
if(part instanceof PortEditPart){
if(((PortEditPart)part).getCastedModel().getTerminal().equals(sourcePort.getTerminal())){
((PortEditPart)part).getPortFigure().removeWatcherColor();
((PortEditPart)part).getPortFigure().setWatched(false);
}
}
}
}
}
}
}
示例3: removeWatch
import org.eclipse.gef.EditPart; //導入方法依賴的package包/類
private void removeWatch(Port sourcePort, Component sourceComponent){
ELTGraphicalEditor editor=(ELTGraphicalEditor) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
GraphicalViewer graphicalViewer =(GraphicalViewer) ((GraphicalEditor)editor).getAdapter(GraphicalViewer.class);
for (Iterator<EditPart> iterator = graphicalViewer.getEditPartRegistry().values().iterator(); iterator.hasNext();)
{
EditPart editPart = (EditPart) iterator.next();
if(editPart instanceof ComponentEditPart)
{
Component comp = ((ComponentEditPart)editPart).getCastedModel();
if(comp.equals(sourceComponent)){
List<PortEditPart> portEditParts = editPart.getChildren();
for(AbstractGraphicalEditPart part:portEditParts)
{
if(part instanceof PortEditPart){
if(((PortEditPart)part).getCastedModel().getTerminal().equals(sourcePort.getTerminal())){
((PortEditPart)part).getPortFigure().removeWatcherColor();
((PortEditPart)part).getPortFigure().setWatched(false);
}
}
}
}
}
}
}
示例4: checkWatcher
import org.eclipse.gef.EditPart; //導入方法依賴的package包/類
/**
* This function returns that watcher is added on selected port
*
*/
public boolean checkWatcher(Component selectedComponent, String portName) {
EditPart editPart = (EditPart) selectedComponent.getComponentEditPart();
List<PortEditPart> portEdit = editPart.getChildren();
for(AbstractGraphicalEditPart part : portEdit){
if(part instanceof PortEditPart){
String portLabel = ((PortEditPart) part).getCastedModel().getTerminal();
if(portLabel.equals(portName)){
return ((PortEditPart) part).getPortFigure().isWatched();
}
}
}
return false;
}
示例5: checkWatcher
import org.eclipse.gef.EditPart; //導入方法依賴的package包/類
private boolean checkWatcher(Component selectedComponent, String portName) {
ELTGraphicalEditor editor = (ELTGraphicalEditor) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
.getActiveEditor();
IPath path = new Path(editor.getTitleToolTip());
String currentJob = path.lastSegment().replace(Constants.JOB_EXTENSION, "");
watchRecordInner.setCurrentJob(currentJob);
GraphicalViewer graphicalViewer = (GraphicalViewer) ((GraphicalEditor) editor).getAdapter(GraphicalViewer.class);
String uniqueJobId = editor.getJobId();
watchRecordInner.setUniqueJobId(uniqueJobId);
for (Iterator<EditPart> iterator = graphicalViewer.getEditPartRegistry().values().iterator(); iterator.hasNext();) {
EditPart editPart = (EditPart) iterator.next();
if (editPart instanceof ComponentEditPart) {
Component comp = ((ComponentEditPart) editPart).getCastedModel();
if (comp.equals(selectedComponent)) {
List<PortEditPart> portEditParts = editPart.getChildren();
for (AbstractGraphicalEditPart part : portEditParts) {
if (part instanceof PortEditPart) {
String port_Name = ((PortEditPart) part).getCastedModel().getTerminal();
if (port_Name.equals(portName)) {
return ((PortEditPart) part).getPortFigure().isWatched();
}
}
}
}
}
}
return false;
}
示例6: changePortColor
import org.eclipse.gef.EditPart; //導入方法依賴的package包/類
private void changePortColor(Component selectedComponent, String portName){
EditPart editPart = (EditPart) selectedComponent.getComponentEditPart();
List<PortEditPart> portEdit = editPart.getChildren();
for(AbstractGraphicalEditPart part : portEdit){
if(part instanceof PortEditPart && ((PortEditPart)part).getCastedModel().getTerminal().equals(portName)){
((PortEditPart)part).getPortFigure().changeWatcherColor();
((PortEditPart)part).getCastedModel().setWatched(true);
((PortEditPart)part).getPortFigure().setWatched(true);
((PortEditPart)part).getPortFigure().repaint();
}
}
}
示例7: changePortColor
import org.eclipse.gef.EditPart; //導入方法依賴的package包/類
private void changePortColor(Component selectedComponent, String portName){
EditPart editPart = (EditPart) selectedComponent.getComponentEditPart();
List<PortEditPart> portEdit = editPart.getChildren();
for(AbstractGraphicalEditPart part : portEdit){
if(part instanceof PortEditPart && ((PortEditPart)part).getCastedModel().getTerminal().equals(portName)){
((PortEditPart)part).getPortFigure().removeWatcherColor();
((PortEditPart)part).getPortFigure().setWatched(false);
((PortEditPart)part).getCastedModel().setWatched(false);
}
}
}