@Override
    protected void addActions(MenuManager menuManager) {
      IAction action =
          createAction(
              Messages.DiagramConnectionLineStyleSection_11,
              IDiagramModelConnection.ARROW_NONE,
              IZentaImages.ImageFactory.getImageDescriptor(IZentaImages.LINE_SOLID));
      action.setChecked(
          (fConnection.getType() & IDiagramModelConnection.ARROW_FILL_TARGET) == 0
              & (fConnection.getType() & IDiagramModelConnection.ARROW_HOLLOW_TARGET) == 0
              & (fConnection.getType() & IDiagramModelConnection.ARROW_LINE_TARGET) == 0);
      menuManager.add(action);

      action =
          createAction(
              Messages.DiagramConnectionLineStyleSection_12,
              IDiagramModelConnection.ARROW_FILL_TARGET,
              IZentaImages.ImageFactory.getImageDescriptor(IZentaImages.ARROW_TARGET_FILL));
      menuManager.add(action);

      action =
          createAction(
              Messages.DiagramConnectionLineStyleSection_13,
              IDiagramModelConnection.ARROW_HOLLOW_TARGET,
              IZentaImages.ImageFactory.getImageDescriptor(IZentaImages.ARROW_TARGET_HOLLOW));
      menuManager.add(action);

      action =
          createAction(
              Messages.DiagramConnectionLineStyleSection_14,
              IDiagramModelConnection.ARROW_LINE_TARGET,
              IZentaImages.ImageFactory.getImageDescriptor(IZentaImages.ARROW_TARGET_LINE));
      menuManager.add(action);
    }
    @Override
    protected void addActions(MenuManager menuManager) {
      IAction action =
          createAction(
              Messages.DiagramConnectionLineStyleSection_2,
              IDiagramModelConnection.LINE_SOLID,
              IZentaImages.ImageFactory.getImageDescriptor(IZentaImages.LINE_SOLID));
      menuManager.add(action);
      action.setChecked(
          (fConnection.getType() & IDiagramModelConnection.LINE_DASHED) == 0
              & (fConnection.getType() & IDiagramModelConnection.LINE_DOTTED) == 0);

      action =
          createAction(
              Messages.DiagramConnectionLineStyleSection_3,
              IDiagramModelConnection.LINE_DASHED,
              IZentaImages.ImageFactory.getImageDescriptor(IZentaImages.LINE_DASHED));
      menuManager.add(action);

      action =
          createAction(
              Messages.DiagramConnectionLineStyleSection_4,
              IDiagramModelConnection.LINE_DOTTED,
              IZentaImages.ImageFactory.getImageDescriptor(IZentaImages.LINE_DOTTED));
      menuManager.add(action);
    }
    @Override
    protected void update() {
      int connectionType = fConnection.getType();

      if ((connectionType & IDiagramModelConnection.LINE_DASHED) != 0) {
        fValue = IDiagramModelConnection.LINE_DASHED;
        fButton.setImage(IZentaImages.ImageFactory.getImage(IZentaImages.LINE_DASHED));
      } else if ((connectionType & IDiagramModelConnection.LINE_DOTTED) != 0) {
        fValue = IDiagramModelConnection.LINE_DOTTED;
        fButton.setImage(IZentaImages.ImageFactory.getImage(IZentaImages.LINE_DOTTED));
      } else {
        fValue = IDiagramModelConnection.LINE_SOLID;
        fButton.setImage(IZentaImages.ImageFactory.getImage(IZentaImages.LINE_SOLID));
      }
    }
    @Override
    protected void update() {
      int connectionType = fConnection.getType();

      if ((connectionType & IDiagramModelConnection.ARROW_FILL_TARGET) != 0) {
        fValue = IDiagramModelConnection.ARROW_FILL_TARGET;
        fButton.setImage(IZentaImages.ImageFactory.getImage(IZentaImages.ARROW_TARGET_FILL));
      } else if ((connectionType & IDiagramModelConnection.ARROW_HOLLOW_TARGET) != 0) {
        fValue = IDiagramModelConnection.ARROW_HOLLOW_TARGET;
        fButton.setImage(IZentaImages.ImageFactory.getImage(IZentaImages.ARROW_TARGET_HOLLOW));
      } else if ((connectionType & IDiagramModelConnection.ARROW_LINE_TARGET) != 0) {
        fValue = IDiagramModelConnection.ARROW_LINE_TARGET;
        fButton.setImage(IZentaImages.ImageFactory.getImage(IZentaImages.ARROW_TARGET_LINE));
      } else {
        fValue = IDiagramModelConnection.ARROW_NONE;
        fButton.setImage(IZentaImages.ImageFactory.getImage(IZentaImages.LINE_SOLID));
      }
    }
 @Override
 public ImageDescriptor getImageDescriptor() {
   return IZentaImages.ImageFactory.getImageDescriptor(IZentaImages.ICON_DIAGRAM_16);
 }
 @Override
 public Image getImage() {
   return IZentaImages.ImageFactory.getImage(IZentaImages.ICON_DIAGRAM_16);
 }
Example #7
0
 @Override
 public Image getImage() {
   return IZentaImages.ImageFactory.getImage(IZentaImages.ICON_MODELS_16);
 }