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


Java PlatformColors类代码示例

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


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

示例1: paintSelectionDecoration

import com.intellij.util.ui.PlatformColors; //导入依赖的package包/类
/**
 * Paints selection for the specified <code>component</code>.
 */
public static void paintSelectionDecoration(@NotNull RadComponent component, Graphics g,
                                            boolean focused) {
  if (component.isSelected()) {
    if (focused) {
      g.setColor(PlatformColors.BLUE);
    }
    else {
      g.setColor(Color.GRAY);
    }
    final Point[] points = getPoints(component.getWidth(), component.getHeight());
    for (final Point point : points) {
      g.fillRect(point.x - R, point.y - R, 2 * R + 1, 2 * R + 1);
    }
  }
  else if (component.getWidth() < FormEditingUtil.EMPTY_COMPONENT_SIZE || component.getHeight() < FormEditingUtil.EMPTY_COMPONENT_SIZE) {
    Graphics2D g2d = (Graphics2D)g;
    Composite oldComposite = g2d.getComposite();
    Stroke oldStroke = g2d.getStroke();
    Color oldColor = g2d.getColor();

    g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_ATOP, 0.5f));
    g2d.setStroke(new BasicStroke(0.7f));
    g2d.setColor(Color.black);
    g2d.drawRect(0, 0, Math.max(component.getWidth(), FormEditingUtil.EMPTY_COMPONENT_SIZE),
                 Math.max(component.getHeight(), FormEditingUtil.EMPTY_COMPONENT_SIZE));

    g2d.setComposite(oldComposite);
    g2d.setStroke(oldStroke);
    g2d.setColor(oldColor);
  }
}
 
开发者ID:consulo,项目名称:consulo-ui-designer,代码行数:35,代码来源:Painter.java

示例2: addAction

import com.intellij.util.ui.PlatformColors; //导入依赖的package包/类
public void addAction(final Action action) {
  action.addPropertyChangeListener(this);
  final LinkLabel label = new LinkLabel(null, null, new LinkListener() {
    @Override
    public void linkSelected(final LinkLabel aSource, final Object aLinkData) {
      action.actionPerformed(new ActionEvent(Banner.this, ActionEvent.ACTION_PERFORMED, Action.ACTION_COMMAND_KEY));
    }
  }) {
    @Override
    protected Color getTextColor() {
      return PlatformColors.BLUE;
    }
  };
  label.setFont(label.getFont().deriveFont(Font.BOLD));
  myActions.put(action, label);
  myActionsPanel.add(label);
  updateAction(action);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:Banner.java

示例3: createComponentForTitle

import com.intellij.util.ui.PlatformColors; //导入依赖的package包/类
static JComponent createComponentForTitle(@Nullable String title,
                                          @Nullable final LineSeparator sep1,
                                          @Nullable final LineSeparator sep2,
                                          boolean left) {
  if (sep1 != null && sep2 != null && !sep1.equals(sep2)) {
    LineSeparator separator = left ? sep1 : sep2;
    JPanel bottomPanel = new JPanel(new BorderLayout());
    JLabel sepLabel = new JLabel(separator.name());
    sepLabel.setForeground(separator.equals(LineSeparator.CRLF) ? JBColor.RED : PlatformColors.BLUE);
    bottomPanel.add(sepLabel, left ? BorderLayout.EAST : BorderLayout.WEST);

    JPanel panel = new JPanel(new BorderLayout());
    panel.add(new JLabel(title == null ? "" : title));
    panel.add(bottomPanel, BorderLayout.SOUTH);
    return panel;
  }
  else {
    return new JBLabel(title == null ? "" : title);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:DiffPanelImpl.java

示例4: update

import com.intellij.util.ui.PlatformColors; //导入依赖的package包/类
@Override
protected void update(PresentationData presentation) {
  String name = myBlock.getClass().getSimpleName();
  if (myBlock instanceof DataLanguageBlockWrapper) {
    name += " (" + ((DataLanguageBlockWrapper)myBlock).getOriginal().getClass().getSimpleName() + ")";
  }
  presentation.addText(name, SimpleTextAttributes.REGULAR_ATTRIBUTES);

  if (myBlock.getIndent() != null) {
    presentation.addText(" " + String.valueOf(myBlock.getIndent()).replaceAll("[<>]", " "), SimpleTextAttributes.GRAY_ATTRIBUTES);
  }
  else {
    presentation.addText(" Indent: null", SimpleTextAttributes.GRAY_ATTRIBUTES);
  }
  if (myBlock.getAlignment() != null) {
    presentation
      .addText(" " + String.valueOf(myBlock.getAlignment()), new SimpleTextAttributes(SimpleTextAttributes.STYLE_BOLD, JBColor.darkGray));
  }
  if (myBlock.getWrap() != null) {
    presentation
      .addText(" " + String.valueOf(myBlock.getWrap()), new SimpleTextAttributes(SimpleTextAttributes.STYLE_ITALIC, PlatformColors.BLUE));
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:BlockTreeNode.java

示例5: paintComponent

import com.intellij.util.ui.PlatformColors; //导入依赖的package包/类
@Override protected void paintComponent(Graphics g) {
  super.paintComponent(g);
  if (myDropTargetIndex >= 0) {
    int dropLineY;
    Rectangle rc;
    if (myDropTargetIndex == myGroup.getItems().length) {
      rc = getCellBounds(myDropTargetIndex-1, myDropTargetIndex-1);
      dropLineY = (int)rc.getMaxY()-1;
    }
    else {
      rc = getCellBounds(myDropTargetIndex, myDropTargetIndex);
      dropLineY = rc.y;
    }
    Graphics2D g2d = (Graphics2D) g;
    g2d.setColor(PlatformColors.BLUE);
    g2d.setStroke(new BasicStroke(2.0f));
    g2d.drawLine(rc.x, dropLineY, rc.x+rc.width, dropLineY);
    g2d.drawLine(rc.x, dropLineY-2, rc.x, dropLineY+2);
    g2d.drawLine(rc.x+rc.width, dropLineY-2, rc.x+rc.width, dropLineY+2);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:PaletteComponentList.java

示例6: getTableCellRendererComponent

import com.intellij.util.ui.PlatformColors; //导入依赖的package包/类
public Component getTableCellRendererComponent(JTable table, Object _value,
                                               boolean isSelected, boolean hasFocus, int row, int column) {
  super.getTableCellRendererComponent(table, _value, isSelected, hasFocus, row, column);
  setForeground(table.getForeground());
  setToolTipText(null);

  for (int i = 0; i < myVariables.size(); i++) {
    Variable variable = myVariables.get(i);
    if (i != row && variable.getName().equals(_value)) {
      setForeground(Color.RED);
      setToolTipText("Duplicate Variable");
    }
    else if (variable.getExpression().length() == 0) {
      setForeground(PlatformColors.BLUE);
      setToolTipText("Empty expression. Variable will evaluate to empty nodeset.");
    }
  }
  return this;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:EditContextDialog.java

示例7: addAction

import com.intellij.util.ui.PlatformColors; //导入依赖的package包/类
public void addAction(final Action action) {
  action.addPropertyChangeListener(this);
  final LinkLabel label = new LinkLabel(null, null, new LinkListener() {
    public void linkSelected(final LinkLabel aSource, final Object aLinkData) {
      action.actionPerformed(new ActionEvent(Banner.this, ActionEvent.ACTION_PERFORMED, Action.ACTION_COMMAND_KEY));
    }
  }) {
    @Override
    protected Color getTextColor() {
      return PlatformColors.BLUE;
    }
  };
  label.setFont(label.getFont().deriveFont(Font.BOLD));
  myActions.put(action, label);
  myActionsPanel.add(label);
  updateAction(action);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:18,代码来源:Banner.java

示例8: update

import com.intellij.util.ui.PlatformColors; //导入依赖的package包/类
@Override
protected void update(PresentationData presentation) {
  String name = myBlock.getClass().getSimpleName();
  if (myBlock instanceof DataLanguageBlockWrapper) {
    name += " (" + ((DataLanguageBlockWrapper)myBlock).getOriginal().getClass().getSimpleName() + ")";
  }
  presentation.addText(name, SimpleTextAttributes.REGULAR_ATTRIBUTES);

  if (myBlock.getIndent() != null) {
    presentation.addText(" " + String.valueOf(myBlock.getIndent()).replaceAll("[<>]", " "), SimpleTextAttributes.GRAY_ATTRIBUTES);
  }
  else {
    presentation.addText(" Indent: null", SimpleTextAttributes.GRAY_ATTRIBUTES);
  }
  if (myBlock.getAlignment() != null) {
    presentation
      .addText(" " + String.valueOf(myBlock.getAlignment()), new SimpleTextAttributes(SimpleTextAttributes.STYLE_BOLD, Color.darkGray));
  }
  if (myBlock.getWrap() != null) {
    presentation
      .addText(" " + String.valueOf(myBlock.getWrap()), new SimpleTextAttributes(SimpleTextAttributes.STYLE_ITALIC, PlatformColors.BLUE));
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:24,代码来源:BlockTreeNode.java

示例9: paintComponent

import com.intellij.util.ui.PlatformColors; //导入依赖的package包/类
@Override
protected void paintComponent(Graphics g)
{
	super.paintComponent(g);
	if(myDropTargetIndex >= 0)
	{
		int dropLineY;
		Rectangle rc;
		if(myDropTargetIndex == myGroup.getItems().length)
		{
			rc = getCellBounds(myDropTargetIndex - 1, myDropTargetIndex - 1);
			dropLineY = (int) rc.getMaxY() - 1;
		}
		else
		{
			rc = getCellBounds(myDropTargetIndex, myDropTargetIndex);
			dropLineY = rc.y;
		}
		Graphics2D g2d = (Graphics2D) g;
		g2d.setColor(PlatformColors.BLUE);
		g2d.setStroke(new BasicStroke(2.0f));
		g2d.drawLine(rc.x, dropLineY, rc.x + rc.width, dropLineY);
		g2d.drawLine(rc.x, dropLineY - 2, rc.x, dropLineY + 2);
		g2d.drawLine(rc.x + rc.width, dropLineY - 2, rc.x + rc.width, dropLineY + 2);
	}
}
 
开发者ID:consulo,项目名称:consulo-ui-designer,代码行数:27,代码来源:PaletteComponentList.java

示例10: createComponentForTitle

import com.intellij.util.ui.PlatformColors; //导入依赖的package包/类
static JComponent createComponentForTitle(@Nullable String title, @Nullable final LineSeparator sep1, @Nullable final LineSeparator sep2, boolean left) {
  if (sep1 != null && sep2 != null && !sep1.equals(sep2)) {
    LineSeparator separator = left ? sep1 : sep2;
    JPanel bottomPanel = new JPanel(new BorderLayout());
    JLabel sepLabel = new JLabel(separator.name());
    sepLabel.setForeground(separator.equals(LineSeparator.CRLF) ? JBColor.RED : PlatformColors.BLUE);
    bottomPanel.add(sepLabel, left ? BorderLayout.EAST : BorderLayout.WEST);

    JPanel panel = new JPanel(new BorderLayout());
    panel.add(new JLabel(title == null ? "" : title));
    panel.add(bottomPanel, BorderLayout.SOUTH);
    return panel;
  }
  else {
    return new JBLabel(title == null ? "" : title);
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:18,代码来源:DiffPanelImpl.java

示例11: HyperlinkLabel

import com.intellij.util.ui.PlatformColors; //导入依赖的package包/类
public HyperlinkLabel(String text) {
  this(text,
       PlatformColors.BLUE,
       new JBColor(new NotNullProducer<Color>() {
         @NotNull
         @Override
         public Color produce() {
           return UIUtil.getLabelBackground();
         }
       }),
       PlatformColors.BLUE);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:HyperlinkLabel.java

示例12: createActionLabel

import com.intellij.util.ui.PlatformColors; //导入依赖的package包/类
public HyperlinkLabel createActionLabel(final String text, final Runnable action) {
  HyperlinkLabel label = new HyperlinkLabel(text, PlatformColors.BLUE, getBackground(), PlatformColors.BLUE);
  label.addHyperlinkListener(new HyperlinkAdapter() {
    @Override
    protected void hyperlinkActivated(HyperlinkEvent e) {
      action.run();
    }
  });
  myLinksPanel.add(label);
  return label;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:EditorNotificationPanel.java

示例13: getListCellRendererComponent

import com.intellij.util.ui.PlatformColors; //导入依赖的package包/类
@Override
public Component getListCellRendererComponent(JList list,
                                              Object value,
                                              int index,
                                              boolean isSelected,
                                              boolean cellHasFocus) {
  if (value instanceof RepoPackage) {
    RepoPackage repoPackage = (RepoPackage) value;
    String name = repoPackage.getName();
    if (myCurrentlyInstalling.contains(name)) {
      final String colorCode = UIUtil.isUnderDarcula() ? "589df6" : "0000FF";
      name = "<html><body>" + repoPackage.getName() + " <font color=\"#" + colorCode + "\">(installing)</font></body></html>";
    }
    myNameLabel.setText(name);
    myRepositoryLabel.setText(repoPackage.getRepoUrl());
    Component orig = super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
    final Color fg = orig.getForeground();
    myNameLabel.setForeground(myInstalledPackages.contains(name) ? PlatformColors.BLUE : fg);
  }
  myRepositoryLabel.setForeground(JBColor.GRAY);

  final Color bg;
  if (isSelected) {
    bg = UIUtil.getListSelectionBackground();
  }
  else {
    bg = index % 2 == 1 ? UIUtil.getListBackground() : UIUtil.getDecoratedRowColor();
  }
  myPanel.setBackground(bg);
  myNameLabel.setBackground(bg);
  myRepositoryLabel.setBackground(bg);
  return myPanel;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:34,代码来源:ManagePackagesDialog.java

示例14: paintFeedback

import com.intellij.util.ui.PlatformColors; //导入依赖的package包/类
public void paintFeedback(Graphics2D g2d, Rectangle rc) {
  g2d.setColor(PlatformColors.BLUE);
  g2d.setStroke(new BasicStroke(1.5f));
  int right = rc.x + rc.width - 1;
  int bottom = rc.y + rc.height - 1;
  int midX = (int) rc.getCenterX();
  g2d.drawLine(rc.x, rc.y, midX, rc.y+GridInsertLocation.INSERT_ARROW_SIZE);
  g2d.drawLine(right, rc.y, midX, rc.y+GridInsertLocation.INSERT_ARROW_SIZE);
  g2d.drawLine(midX, rc.y+GridInsertLocation.INSERT_ARROW_SIZE,
               midX, bottom-GridInsertLocation.INSERT_ARROW_SIZE);
  g2d.drawLine(rc.x, bottom, midX, bottom-GridInsertLocation.INSERT_ARROW_SIZE);
  g2d.drawLine(right, bottom, midX, bottom-GridInsertLocation.INSERT_ARROW_SIZE);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:VertInsertFeedbackPainter.java

示例15: paintFeedback

import com.intellij.util.ui.PlatformColors; //导入依赖的package包/类
public void paintFeedback(Graphics2D g2d, Rectangle rc) {
  g2d.setColor(PlatformColors.BLUE);
  g2d.setStroke(new BasicStroke(1.5f));
  int midY = (int)rc.getCenterY();
  int right = rc.x + rc.width - 1;
  int bottom = rc.y + rc.height - 1;
  g2d.drawLine(rc.x, rc.y, GridInsertLocation.INSERT_ARROW_SIZE, midY);
  g2d.drawLine(rc.x, bottom, GridInsertLocation.INSERT_ARROW_SIZE, midY);
  g2d.drawLine(GridInsertLocation.INSERT_ARROW_SIZE, midY,
               right - GridInsertLocation.INSERT_ARROW_SIZE, midY);
  g2d.drawLine(right, rc.y,
               rc.x+rc.width-GridInsertLocation.INSERT_ARROW_SIZE, midY);
  g2d.drawLine(right, bottom,
               right-GridInsertLocation.INSERT_ARROW_SIZE, midY);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:HorzInsertFeedbackPainter.java


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