当前位置: 首页>>代码示例>>Java>>正文


Java SVGResource类代码示例

本文整理汇总了Java中org.vectomatic.dom.svg.ui.SVGResource的典型用法代码示例。如果您正苦于以下问题:Java SVGResource类的具体用法?Java SVGResource怎么用?Java SVGResource使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SVGResource类属于org.vectomatic.dom.svg.ui包,在下文中一共展示了SVGResource类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: displayMachineOutput

import org.vectomatic.dom.svg.ui.SVGResource; //导入依赖的package包/类
protected void displayMachineOutput(DisplayMachineOutputEvent event) {
  String machineName = event.getMachineName();
  OutputConsole outputConsole = consoles.get(machineName);

  if (outputConsole == null) {
    return;
  }

  outputConsole.go(
      widget -> {
        String title = outputConsole.getTitle();
        SVGResource icon = outputConsole.getTitleIcon();
        view.addWidget(machineName, title, icon, widget, true);
        ProcessTreeNode node = view.getNodeById(machineName);
        view.selectNode(node);
        notifyTreeNodeSelected(node);
      });

  outputConsole.addActionDelegate(this);
}
 
开发者ID:eclipse,项目名称:che,代码行数:21,代码来源:ProcessesPanelPresenter.java

示例2: NewClikeResourceAction

import org.vectomatic.dom.svg.ui.SVGResource; //导入依赖的package包/类
/**
 * Creates new action.
 *
 * @param title action's title
 * @param description action's description
 * @param svgIcon
 */
public NewClikeResourceAction(
    String title,
    String description,
    SVGResource svgIcon,
    DialogFactory dialogFactory,
    CoreLocalizationConstant coreLocalizationConstant,
    EventBus eventBus,
    AppContext appContext,
    NotificationManager notificationManager,
    Provider<EditorAgent> editorAgentProvider) {
  super(
      title,
      description,
      svgIcon,
      dialogFactory,
      coreLocalizationConstant,
      eventBus,
      appContext,
      notificationManager,
      editorAgentProvider);
  this.appContext = appContext;
}
 
开发者ID:eclipse,项目名称:che,代码行数:30,代码来源:NewClikeResourceAction.java

示例3: GoalPopUpGroup

import org.vectomatic.dom.svg.ui.SVGResource; //导入依赖的package包/类
@Inject
GoalPopUpGroup(
    @Assisted String goalId,
    ActionManager actionManager,
    CommandGoalRegistry goalRegistry,
    IconRegistry iconRegistry) {
  super(actionManager);

  this.iconRegistry = iconRegistry;
  commandGoal = goalRegistry.getGoalForId(goalId);

  setPopup(true);

  // set icon
  final SVGResource commandTypeIcon = getCommandGoalIcon();
  if (commandTypeIcon != null) {
    getTemplatePresentation().setImageElement(new SVGImage(commandTypeIcon).getElement());
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:20,代码来源:GoalPopUpGroup.java

示例4: getCommandGoalIcon

import org.vectomatic.dom.svg.ui.SVGResource; //导入依赖的package包/类
/** Returns the icon for the given command goal ID or {@code null} if none. */
@Nullable
public SVGResource getCommandGoalIcon(String goalId) {
  final Optional<CommandGoal> goalOptional = goalRegistry.getPredefinedGoalById(goalId);

  if (goalOptional.isPresent()) {
    final Icon icon = iconRegistry.getIconIfExist("command.goal." + goalOptional.get().getId());

    if (icon != null) {
      final SVGImage svgImage = icon.getSVGImage();

      if (svgImage != null) {
        return icon.getSVGResource();
      }
    }
  }

  return null;
}
 
开发者ID:eclipse,项目名称:che,代码行数:20,代码来源:CommandUtils.java

示例5: NewCSharplikeResourceAction

import org.vectomatic.dom.svg.ui.SVGResource; //导入依赖的package包/类
/**
 * Creates new action.
 *
 * @param title action's title
 * @param description action's description
 * @param svgIcon
 */
public NewCSharplikeResourceAction(
    String title,
    String description,
    SVGResource svgIcon,
    DialogFactory dialogFactory,
    CoreLocalizationConstant coreLocalizationConstant,
    EventBus eventBus,
    AppContext appContext,
    NotificationManager notificationManager,
    Provider<EditorAgent> editorAgentProvider) {
  super(
      title,
      description,
      svgIcon,
      dialogFactory,
      coreLocalizationConstant,
      eventBus,
      appContext,
      notificationManager,
      editorAgentProvider);
  this.appContext = appContext;
}
 
开发者ID:eclipse,项目名称:che,代码行数:30,代码来源:NewCSharplikeResourceAction.java

示例6: NewPhplikeResourceAction

import org.vectomatic.dom.svg.ui.SVGResource; //导入依赖的package包/类
/**
 * Creates new action.
 *
 * @param title action's title
 * @param description action's description
 * @param svgIcon
 */
public NewPhplikeResourceAction(
    String title,
    String description,
    SVGResource svgIcon,
    DialogFactory dialogFactory,
    CoreLocalizationConstant coreLocalizationConstant,
    EventBus eventBus,
    AppContext appContext,
    NotificationManager notificationManager,
    Provider<EditorAgent> editorAgentProvider) {
  super(
      title,
      description,
      svgIcon,
      dialogFactory,
      coreLocalizationConstant,
      eventBus,
      appContext,
      notificationManager,
      editorAgentProvider);
  this.appContext = appContext;
}
 
开发者ID:eclipse,项目名称:che,代码行数:30,代码来源:NewPhplikeResourceAction.java

示例7: NodeWidget

import org.vectomatic.dom.svg.ui.SVGResource; //导入依赖的package包/类
public NodeWidget(
    String nodeName, ProjectClasspathResources resources, int nodeKind, SVGResource nodeIcon) {
  this.resources = resources;
  this.nodeName = nodeName;
  this.nodeKind = nodeKind;

  initWidget(UI_BINDER.createAndBindUi(this));

  SVGImage icon = new SVGImage(nodeIcon.getSvg());
  this.icon.getElement().appendChild(icon.getSvgElement().getElement());
  this.removeButton.getElement().appendChild(resources.removeNode().getSvg().getElement());

  name.setText(nodeName);

  removeButton.addDomHandler(
      new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
          delegate.onRemoveButtonClicked(NodeWidget.this);
        }
      },
      ClickEvent.getType());
  addDomHandler(this, ClickEvent.getType());
}
 
开发者ID:eclipse,项目名称:che,代码行数:25,代码来源:NodeWidget.java

示例8: JsonExampleProjectAction

import org.vectomatic.dom.svg.ui.SVGResource; //导入依赖的package包/类
/**
 * Constructor.
 *
 * @param appContext the IDE application context
 * @param text the text of the action
 * @param description the description of the action
 * @param svgResource the icon of the resource
 */
public JsonExampleProjectAction(
    AppContext appContext,
    @NotNull String text,
    @NotNull String description,
    @Nullable SVGResource svgResource) {
  super(Collections.singletonList(PROJECT_PERSPECTIVE_ID), text, description, null, svgResource);
  this.appContext = appContext;
}
 
开发者ID:eclipse,项目名称:che-archetypes,代码行数:17,代码来源:JsonExampleProjectAction.java

示例9: temporaryButton

import org.vectomatic.dom.svg.ui.SVGResource; //导入依赖的package包/类
@Source("temporary/temporary.svg")
SVGResource temporaryButton();
 
开发者ID:codenvy,项目名称:codenvy,代码行数:3,代码来源:HostedResources.java

示例10: updatePresentation

import org.vectomatic.dom.svg.ui.SVGResource; //导入依赖的package包/类
@Override
public void updatePresentation(NodePresentation presentation) {
  presentation.setPresentableText(getName().toUpperCase() + " (" + commands.size() + ")");
  presentation.setPresentableTextCss("font-weight: bold;");

  final SVGResource goalIcon = commandUtils.getCommandGoalIcon(getData().getId());
  if (goalIcon != null) {
    presentation.setPresentableIcon(goalIcon);
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:11,代码来源:CommandGoalNode.java

示例11: shouldFireEventWhenSelectionInActivePartChanged

import org.vectomatic.dom.svg.ui.SVGResource; //导入依赖的package包/类
/** If selection chang in active part, Selection Agent should fire an Event */
@Test
public void shouldFireEventWhenSelectionInActivePartChanged() {

  AbstractPartPresenter part =
      new AbstractPartPresenter() {
        @Override
        public void go(AcceptsOneWidget container) {}

        @Override
        public String getTitleToolTip() {
          return null;
        }

        @Override
        public SVGResource getTitleImage() {
          return null;
        }

        @Override
        public String getTitle() {
          return null;
        }

        @Override
        public IsWidget getView() {
          return null;
        }
      };

  // fire event, for agent to get information about active part
  eventBus.fireEvent(new ActivePartChangedEvent(part));
  SelectionChangedHandler handler = mock(SelectionChangedHandler.class);
  eventBus.addHandler(SelectionChangedEvent.TYPE, handler);

  part.setSelection(mock(Selection.class));

  verify(handler).onSelectionChanged((SelectionChangedEvent) any());
}
 
开发者ID:eclipse,项目名称:che,代码行数:40,代码来源:TestSelectionAgent.java

示例12: updatePresentation

import org.vectomatic.dom.svg.ui.SVGResource; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public void updatePresentation(@NotNull NodePresentation presentation) {
  StringBuilder presentableName = new StringBuilder(field.getElementName());
  if (isShowInheritedMembers) {
    String path = field.getRootPath();
    String className =
        field.isBinary()
            ? path.substring(path.lastIndexOf('.') + 1)
            : path.substring(path.lastIndexOf('/') + 1, path.indexOf('.'));
    presentableName.append(" -> ").append(className);
  }

  updatePresentationField(isFromSuper, presentation, presentableName.toString(), resources);

  int flag = field.getFlags();
  SVGResource icon;
  if (Flags.isPublic(flag)) {
    icon = resources.publicMethod();
  } else if (Flags.isPrivate(flag)) {
    icon = resources.privateMethod();
  } else if (Flags.isProtected(flag)) {
    icon = resources.protectedMethod();
  } else {
    icon = resources.publicMethod();
  }
  presentation.setPresentableIcon(icon);
}
 
开发者ID:eclipse,项目名称:che,代码行数:29,代码来源:FieldNode.java

示例13: Icon

import org.vectomatic.dom.svg.ui.SVGResource; //导入依赖的package包/类
/**
 * Create a new icon based on the specified {@link SVGResource}.
 *
 * @param id icon id
 * @param svgResource resource that contains SVG
 */
public Icon(String id, SVGResource svgResource) {
  this.id = id;
  this.sourcePath = null;
  this.svgResource = svgResource;
  this.imageResource = null;
}
 
开发者ID:eclipse,项目名称:che,代码行数:13,代码来源:Icon.java

示例14: Annotation

import org.vectomatic.dom.svg.ui.SVGResource; //导入依赖的package包/类
/**
 * Creates a new annotation with the given properties.
 *
 * @param type the unique name of this annotation type
 * @param isPersistent <code>true</code> if this annotation is persistent, <code>false</code>
 *     otherwise
 * @param text the text associated with this annotation
 * @param layer annotation draw layer
 * @param image image associated with this annotation
 * @param imageSVG image associated with this annotation
 */
public Annotation(
    String type,
    boolean isPersistent,
    String text,
    int layer,
    ImageResource image,
    SVGResource imageSVG) {
  this.type = type;
  this.isPersistent = isPersistent;
  this.text = text;
  this.layer = layer;
  this.image = image;
  this.imageSVG = imageSVG;
}
 
开发者ID:eclipse,项目名称:che,代码行数:26,代码来源:Annotation.java

示例15: updatePresentation

import org.vectomatic.dom.svg.ui.SVGResource; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public void updatePresentation(@NotNull NodePresentation presentation) {
  StringBuilder presentableName = new StringBuilder(type.getLabel());
  if (isShowInheritedMembers && !type.isPrimary()) {
    String path = type.getRootPath();
    String className =
        type.isBinary()
            ? path.substring(path.lastIndexOf('.') + 1)
            : path.substring(path.lastIndexOf('/') + 1, path.indexOf('.'));

    presentableName.append(" -> ").append(className);
  }

  updatePresentationField(isFromSuper, presentation, presentableName.toString(), resources);

  int flags = type.getFlags();
  SVGResource icon;
  if (Flags.isInterface(flags)) {
    icon = resources.interfaceItem();
  } else if (Flags.isEnum(flags)) {
    icon = resources.enumItem();
  } else if (Flags.isAnnotation(flags)) {
    icon = resources.annotationItem();
  } else {
    icon = resources.javaFile();
  }
  presentation.setPresentableIcon(icon);
}
 
开发者ID:eclipse,项目名称:che,代码行数:30,代码来源:TypeNode.java


注:本文中的org.vectomatic.dom.svg.ui.SVGResource类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。