本文整理汇总了Java中com.intellij.ui.Gray类的典型用法代码示例。如果您正苦于以下问题:Java Gray类的具体用法?Java Gray怎么用?Java Gray使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Gray类属于com.intellij.ui包,在下文中一共展示了Gray类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: CompilerUIConfigurable
import com.intellij.ui.Gray; //导入依赖的package包/类
public CompilerUIConfigurable(@NotNull final Project project) {
myProject = project;
myPatternLegendLabel.setText(XmlStringUtil.wrapInHtml(
"Use <b>;</b> to separate patterns and <b>!</b> to negate a pattern. " +
"Accepted wildcards: <b>?</b> — exactly one symbol; <b>*</b> — zero or more symbols; " +
"<b>/</b> — path separator; <b>/**/</b> — any number of directories; " +
"<i><dir_name></i>:<i><pattern></i> — restrict to source roots with the specified name"
));
myPatternLegendLabel.setForeground(new JBColor(Gray._50, Gray._130));
tweakControls(project);
myVMOptionsField.getDocument().addDocumentListener(new DocumentAdapter() {
protected void textChanged(DocumentEvent e) {
mySharedVMOptionsField.setEnabled(e.getDocument().getLength() == 0);
myHeapSizeField.setEnabled(ContainerUtil.find(ParametersListUtil.parse(myVMOptionsField.getText()), new Condition<String>() {
@Override
public boolean value(String s) {
return StringUtil.startsWithIgnoreCase(s, "-Xmx");
}
}) == null);
}
});
}
示例2: paint
import com.intellij.ui.Gray; //导入依赖的package包/类
public void paint(Graphics g) {
if (myCachedImage != null && myMagnificationPoint != null && myMagnification != 0) {
double scale = magnificationToScale(myMagnification);
int xoffset = (int)(myMagnificationPoint.x - myMagnificationPoint.x * scale);
int yoffset = (int)(myMagnificationPoint.y - myMagnificationPoint.y * scale);
Rectangle clip = g.getClipBounds();
g.setColor(Gray._120);
g.fillRect(clip.x, clip.y, clip.width, clip.height);
Graphics2D translated = (Graphics2D)g.create();
translated.translate(xoffset, yoffset);
translated.scale(scale, scale);
UIUtil.drawImage(translated, myCachedImage, 0, 0, null);
}
}
示例3: paintBorder
import com.intellij.ui.Gray; //导入依赖的package包/类
public void paintBorder(final Component c, final Graphics g, final int x, final int y, final int width, final int height) {
final Graphics2D g2d = (Graphics2D) g.create();
final Color background = UIUtil.getPanelBackground();
g2d.setColor(background);
g2d.fillRect(0, 0, width, height);
Color topColor = UIUtil.isUnderDarcula() ? BORDER_TOP_COLOR.darker().darker() : BORDER_TOP_COLOR;
if (SystemInfo.isMac && UIUtil.isUnderIntelliJLaF()) {
topColor = Gray.xC9;
}
g2d.setColor(topColor);
g2d.drawLine(0, 0, width, 0);
if (!UIUtil.isUnderDarcula()) {
g2d.setColor(BORDER_BOTTOM_COLOR);
g2d.drawLine(0, height, width, height);
}
g2d.dispose();
}
示例4: paint
import com.intellij.ui.Gray; //导入依赖的package包/类
public final void paint(final Graphics g){
super.paint(g);
final JBColor lightGray = new JBColor(Color.lightGray, Gray._95);
final JBColor gray = new JBColor(Color.gray, Gray._95);
if(ANCHOR_TOP==myAnchor){
g.setColor(lightGray);
UIUtil.drawLine(g, 0, 0, getWidth() - 1, 0);
UIUtil.drawLine(g, 0, 0, 0, getHeight() - 1);
g.setColor(JBColor.GRAY);
UIUtil.drawLine(g, getWidth() - 1, 0, getWidth() - 1, getHeight() - 1);
} else if(ANCHOR_LEFT==myAnchor){
g.setColor(lightGray);
UIUtil.drawLine(g, 0, 0, 0, getHeight() - 1);
} else {
if(ANCHOR_BOTTOM==myAnchor){
g.setColor(lightGray);
UIUtil.drawLine(g, 0, 0, 0, getHeight() - 1);
g.setColor(gray);
UIUtil.drawLine(g, 0, getHeight() - 1, getWidth() - 1, getHeight() - 1);
UIUtil.drawLine(g, getWidth() - 1, 0, getWidth() - 1, getHeight() - 1);
} else{ // RIGHT
g.setColor(gray);
UIUtil.drawLine(g, getWidth() - 1, 0, getWidth() - 1, getHeight() - 1);
}
}
}
示例5: getBorder
import com.intellij.ui.Gray; //导入依赖的package包/类
@Override
public Border getBorder() {
//avoid moving lines
if (myState == State.EXPANDING || myState == State.COLLAPSING) {
return new EmptyBorder(0,0,0,0);
}
//fix for Darcula double border
if (myState == State.TEMPORARY_EXPANDED && UIUtil.isUnderDarcula()) {
return new CustomLineBorder(Gray._75, 0, 0, 1, 0);
}
//save 1px for mouse handler
if (myState == State.COLLAPSED) {
return new EmptyBorder(0, 0, 1, 0);
}
return UISettings.getInstance().SHOW_MAIN_TOOLBAR || UISettings.getInstance().SHOW_NAVIGATION_BAR ? super.getBorder() : null;
}
示例6: paintEmptyText
import com.intellij.ui.Gray; //导入依赖的package包/类
public void paintEmptyText(@NotNull final JComponent splitters, @NotNull Graphics g) {
UISettings.setupAntialiasing(g);
g.setColor(new JBColor(Gray._80, Gray._160));
g.setFont(JBUI.Fonts.label(16f));
UIUtil.TextPainter painter = new UIUtil.TextPainter().withLineSpacing(1.8f);
advertiseActions(splitters, painter);
painter.draw(g, new PairFunction<Integer, Integer, Couple<Integer>>() {
@Override
public Couple<Integer> fun(Integer width, Integer height) {
Dimension s = splitters.getSize();
int w = (s.width - width) / 2;
int h = s.height * 3 / 8; // fix vertical position @ golden ratio
return Couple.of(w, h);
}
});
}
示例7: paintComponent
import com.intellij.ui.Gray; //导入依赖的package包/类
@Override
protected void paintComponent(final Graphics g) {
final Insets i = getInsets();
if (UIUtil.isUnderAquaBasedLookAndFeel() || UIUtil.isUnderDarcula()) {
if (getParent() != null) {
final JBColor col = new JBColor(Gray._128, Gray._111);
final Graphics2D g2 = (Graphics2D)g;
if (myOrientation == SwingConstants.HORIZONTAL) {
UIUtil.drawDoubleSpaceDottedLine(g2, i.top + 2, getParent().getSize().height - 2 - i.top - i.bottom, 3, col, false);
} else {
UIUtil.drawDoubleSpaceDottedLine(g2, i.left + 2, getParent().getSize().width - 2 - i.left - i.right, 3, col, true);
}
}
}
else {
g.setColor(UIUtil.getSeparatorColor());
if (getParent() != null) {
if (myOrientation == SwingConstants.HORIZONTAL) {
UIUtil.drawLine(g, 3, 2, 3, getParent().getSize().height - 2);
}
else {
UIUtil.drawLine(g, 2, 3, getParent().getSize().width - 2, 3);
}
}
}
}
示例8: paint
import com.intellij.ui.Gray; //导入依赖的package包/类
@Override
public void paint(Graphics g) {
boolean isDarkBackground = UIUtil.isUnderDarcula();
UISettings.setupAntialiasing(g);
g.setColor(new JBColor(isDarkBackground ? Gray._230 : Gray._80, Gray._160));
g.setFont(JBUI.Fonts.label(isDarkBackground ? 24f : 20f));
UIUtil.TextPainter painter = new UIUtil.TextPainter().withLineSpacing(1.5f);
painter.withShadow(true, new JBColor(Gray._200.withAlpha(100), Gray._0.withAlpha(255)));
painter.appendLine("No files are open");//.underlined(new JBColor(Gray._150, Gray._180));
painter.draw(g, new PairFunction<Integer, Integer, Couple<Integer>>() {
@Override
public Couple<Integer> fun(Integer width, Integer height) {
Dimension s = EmptyStatePanel.this.getSize();
return Couple.of((s.width - width) / 2, (s.height - height) / 2);
}
});
}
示例9: paintNode
import com.intellij.ui.Gray; //导入依赖的package包/类
protected void paintNode(Graphics g) {
Color color;
if (mySelected) {
if (myHasFocus){
color = getSelectionBackground();
}
else{
color = Gray._223;
}
}
else{
color = getTextBackground();
if (color == null){
color = getBackground();
}
}
if (color != null){
int i1 = getBorderLeft();
g.setColor(color);
g.fillRect(i1 - 1, 0, getWidth() - i1, getHeight());
}
}
示例10: render
import com.intellij.ui.Gray; //导入依赖的package包/类
public void render(int indentX, int indentY, List<AboutBoxLine> lines) throws OverflowException {
x = indentX;
y = indentY;
ApplicationInfoEx appInfo = (ApplicationInfoEx)ApplicationInfo.getInstance();
for (AboutBoxLine line : lines) {
final String s = line.getText();
setFont(line.isBold() ? myBoldFont : myFont);
if (line.getUrl() != null) {
g2.setColor(myLinkColor);
FontMetrics metrics = g2.getFontMetrics(font);
myLinks.add(new Link(new Rectangle(x, yBase + y - fontAscent, metrics.stringWidth(s), fontHeight), line.getUrl()));
}
else {
g2.setColor(Registry.is("ide.new.about") ? Gray.x33 : appInfo.getAboutForeground());
}
renderString(s, indentX);
if (!line.isKeepWithNext() && !line.equals(lines.get(lines.size()-1))) {
lineFeed(indentX, s);
}
}
}
示例11: paintBorder
import com.intellij.ui.Gray; //导入依赖的package包/类
@Override
public void paintBorder(Component c, Graphics g2d, int x, int y, int width, int height) {
if (TextFieldWithPopupHandlerUI.isSearchField(c)) {
return;
}
Graphics2D g = (Graphics2D)g2d;
//todo[kb]: make a better solution
if (c.getParent() instanceof JComboBox) return;
if (c.hasFocus()) {
MacIntelliJBorderPainter.paintBorder(c, g, 0, 0, c.getWidth(), c.getHeight());
}
if (!IntelliJLaf.isGraphite() || !c.hasFocus()) {
g.setColor(Gray.xB4);
g.drawRect(3, 3, c.getWidth() - 6, c.getHeight() - 6);
}
}
示例12: PluginHeaderPanel
import com.intellij.ui.Gray; //导入依赖的package包/类
public PluginHeaderPanel(@Nullable PluginManagerMain manager) {
myManager = manager;
final Font font = myName.getFont();
myName.setFont(new Font(font.getFontName(), font.getStyle(), font.getSize() + 2));
final JBColor greyed = new JBColor(Gray._130, Gray._200);
myCategory.setForeground(greyed);
myDownloads.setForeground(greyed);
myUpdated.setForeground(greyed);
myVersion.setForeground(greyed);
final Font smallFont = new Font(font.getFontName(), font.getStyle(), font.getSize() - 1);
myCategory.setFont(smallFont);
myVersion.setFont(smallFont);
myDownloads.setFont(smallFont);
myUpdated.setFont(smallFont);
myRoot.setVisible(false);
}
示例13: paintIcon
import com.intellij.ui.Gray; //导入依赖的package包/类
@Override
public void paintIcon(final Component component, final Graphics g, final int i, final int j) {
final int iconWidth = getIconWidth();
final int iconHeight = getIconHeight();
g.setColor(getIconColor());
final int x = i + (iconWidth - myColorSize) / 2;
final int y = j + (iconHeight - myColorSize) / 2;
g.fillRect(x, y, myColorSize, myColorSize);
if (myBorder) {
g.setColor(Gray.x00.withAlpha(40));
g.drawRect(x, y, myColorSize, myColorSize);
}
}
示例14: itemHovered
import com.intellij.ui.Gray; //导入依赖的package包/类
@Override
public void itemHovered(@Nullable BreadcrumbsPsiItem item) {
if (!Registry.is("editor.breadcrumbs.highlight.on.hover")) {
return;
}
HighlightManager hm = HighlightManager.getInstance(myProject);
if (myHighlighed != null) {
for (RangeHighlighter highlighter : myHighlighed) {
hm.removeSegmentHighlighter(myEditor, highlighter);
}
myHighlighed = null;
}
if (item != null) {
final TextRange range = item.getPsiElement().getTextRange();
final TextAttributes attributes = new TextAttributes();
final CrumbPresentation p = item.getPresentation();
final Color color = p != null ? p.getBackgroundColor(false, false, false) : BreadcrumbsComponent.ButtonSettings.DEFAULT_BG_COLOR;
final Color background = EditorColorsManager.getInstance().getGlobalScheme().getColor(EditorColors.CARET_ROW_COLOR);
attributes.setBackgroundColor(XmlTagTreeHighlightingUtil.makeTransparent(color, background != null ? background : Gray._200, 0.3));
myHighlighed = new ArrayList<RangeHighlighter>(1);
int flags = HighlightManager.HIDE_BY_ESCAPE | HighlightManager.HIDE_BY_TEXT_CHANGE | HighlightManager.HIDE_BY_ANY_KEY;
hm.addOccurrenceHighlight(myEditor, range.getStartOffset(), range.getEndOffset(), attributes, flags, myHighlighed, null);
}
}
示例15: paintIcon
import com.intellij.ui.Gray; //导入依赖的package包/类
@Override
public void paintIcon(Component c, Graphics g, int x, int y) {
if (myColor.getAlpha() != 0xff) {
final RoundRectangle2D.Double clip =
new RoundRectangle2D.Double(x, y, myCellSize, myCellSize, ARC_SIZE, ARC_SIZE);
GraphicsUtil.paintCheckeredBackground(g, clip);
}
g.setColor(myColor);
g.fillRoundRect(x, y, myCellSize, myCellSize, ARC_SIZE, ARC_SIZE);
myColor.getRGBComponents(myRgbaArray);
if (Math.pow(1.0 - myRgbaArray[0], 2) + Math.pow(1.0 - myRgbaArray[1], 2) + Math.pow(1.0 - myRgbaArray[2], 2) < THRESHOLD_SQUARED_DISTANCE) {
// Drawing a border to avoid displaying white boxes on a white background
g.setColor(Gray._239);
g.drawRoundRect(x, y, myCellSize, myCellSize - 1, ARC_SIZE, ARC_SIZE);
}
}