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


Java Gray类代码示例

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


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

示例1: paintBorder

import com.bulenkov.iconloader.util.Gray; //导入依赖的package包/类
@Override
public void paintBorder(Component c, Graphics g2, int x, int y, int width, int height) {
    if (DarculaTextFieldUI.isSearchField(c)) {
        return;
    }

    Graphics2D g = ((Graphics2D) g2);
    final GraphicsConfig config = new GraphicsConfig(g);
    g.translate(x, y);

    if (c.hasFocus()) {
        if (valid) {
            DarculaUIUtil.paintFocusRing(g, 2, 2, width - 4, height - 4);
        } else {
            DarculaUIUtil.paintFocusRing(g, INVALID_DOUBLE_COLOR, new Rectangle(2, 2, width - 4, height - 4));
        }
    } else {
        boolean editable = !(c instanceof JTextComponent) || (((JTextComponent) c).isEditable());
        g.setColor(c.isEnabled() && editable ? Gray._100 : new Color(0x535353));
        g.drawRect(1, 1, width - 2, height - 2);
    }

    g.translate(-x, -y);
    config.restore();
}
 
开发者ID:m-lima,项目名称:KATscans,代码行数:26,代码来源:ValidatableBorder.java

示例2: paintBorder

import com.bulenkov.iconloader.util.Gray; //导入依赖的package包/类
@Override
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
  final Graphics2D g2d = (Graphics2D)g;
  final Insets ins = getBorderInsets(c);
  final int yOff = (ins.top + ins.bottom) / 4;
  final boolean square = DarculaButtonUI.isSquare(c);
  int offset = square ? 1 : getOffset();
  if (c.hasFocus()) {
    DarculaUIUtil.paintFocusRing(g2d, offset, yOff, width - 2 * offset, height - 2 * yOff);
  } else {
    final GraphicsConfig config = new GraphicsConfig(g);
    g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
    g2d.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_DEFAULT);
    g2d.setPaint(new GradientPaint(width / 2, y + yOff + 1, Gray._80.withAlpha(90), width / 2, height - 2 * yOff, Gray._90.withAlpha(90)));
    //g.drawRoundRect(x + offset + 1, y + yOff + 1, width - 2 * offset, height - 2*yOff, 5, 5);

    ((Graphics2D)g).setPaint(Gray._100.withAlpha(180));
    g.drawRoundRect(x + offset, y + yOff, width - 2 * offset, height - 2*yOff, square ? 3 : 5, square ? 3 : 5);

    config.restore();
  }
}
 
开发者ID:bulenkov,项目名称:Darcula,代码行数:23,代码来源:DarculaButtonPainter.java

示例3: paintBorder

import com.bulenkov.iconloader.util.Gray; //导入依赖的package包/类
@Override
public void paintBorder(Component c, Graphics g2, int x, int y, int width, int height) {
  if (DarculaTextFieldUI.isSearchField(c)) return;
  Graphics2D g = ((Graphics2D)g2);
  final GraphicsConfig config = new GraphicsConfig(g);
  g.translate(x, y);

  if (c.hasFocus()) {
    DarculaUIUtil.paintFocusRing(g, 2, 2, width - 4, height - 4);
  } else {
    boolean editable = !(c instanceof JTextComponent) || (((JTextComponent)c).isEditable());
    g.setColor(c.isEnabled() && editable ? Gray._100 : new Color(0x535353));
    g.drawRect(1, 1, width - 2, height - 2);
  }
  g.translate(-x, -y);
  config.restore();
}
 
开发者ID:bulenkov,项目名称:Darcula,代码行数:18,代码来源:DarculaTextBorder.java

示例4: ImageSelector

import com.bulenkov.iconloader.util.Gray; //导入依赖的package包/类
public ImageSelector()
{
	setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));

	setCursor(new Cursor(Cursor.HAND_CURSOR));
	addMouseListener(this);

	Component verticalGlue = Box.createVerticalGlue();
	add(verticalGlue);

	btRemove = new JButton(new ImageIcon(getClass().getResource("/images/remove_16.png")));
	btRemove.setToolTipText(MessageSource.getInstance().getString("ImageSelector.cleanImage"));
	btRemove.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
	btRemove.setContentAreaFilled(false);
	btRemove.setFocusPainted(false);
	btRemove.setOpaque(false);
	btRemove.setBorderPainted(false);
	btRemove.setPreferredSize(new Dimension(16, 16));
	btRemove.setMaximumSize(new Dimension(16, 16));
	btRemove.setVisible(false);
	btRemove.addActionListener(new ActionListener() {

		@Override
		public void actionPerformed(ActionEvent arg0)
		{
			image = null;
			imageResized = null;
			repaint();
			btRemove.setVisible(false);
			setCursor(new Cursor(Cursor.HAND_CURSOR));
			setToolTipText(MessageSource.getInstance().getString("ImageSelector.openImage"));
		}
	});
	add(btRemove);

	setToolTipText(MessageSource.getInstance().getString("ImageSelector.openImage"));

	setBorder(new RoundedBorder(Gray._100));
}
 
开发者ID:alessandrojean,项目名称:manga-no-keiei,代码行数:40,代码来源:ImageSelector.java

示例5: ImageScroller

import com.bulenkov.iconloader.util.Gray; //导入依赖的package包/类
public ImageScroller(Icon icon) {
    super();
    JPanel p = new JPanel();
    p.setBackground(new DoubleColor(Color.white, Gray._80));
    p.setLayout(new BorderLayout());

    p.add(new JLabel(icon), BorderLayout.CENTER);

    getViewport().add(p);
    getHorizontalScrollBar().setUnitIncrement(10);
    getVerticalScrollBar().setUnitIncrement(10);
}
 
开发者ID:bulenkov,项目名称:Darcula,代码行数:13,代码来源:InternalFrameDemo.java

示例6: paintCheckIcon

import com.bulenkov.iconloader.util.Gray; //导入依赖的package包/类
@Override
protected void paintCheckIcon(Graphics g2, MenuItemLayoutHelper lh, MenuItemLayoutHelper.LayoutResult lr, Color holdc, Color foreground) {
  Graphics2D g = (Graphics2D) g2;
  final GraphicsConfig config = new GraphicsConfig(g);
  g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
  g.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_DEFAULT);

  g.translate(lr.getCheckRect().x+2, lr.getCheckRect().y+2);

  final int sz = 13;
  g.setPaint(new GradientPaint(sz / 2, 1, Gray._110, sz / 2, sz, Gray._95));
  g.fillRoundRect(0, 0, sz, sz - 1 , 4, 4);

  g.setPaint(new GradientPaint(sz / 2, 1, Gray._120.withAlpha(0x5a), sz / 2, sz, Gray._105.withAlpha(90)));
  g.drawRoundRect(0, (UIUtil.isUnderDarcula() ? 1 : 0), sz, sz - 1, 4, 4);

  g.setPaint(Gray._40.withAlpha(180));
  g.drawRoundRect(0, 0, sz, sz - 1, 4, 4);


  if (lh.getMenuItem().isSelected()) {
    g.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_PURE);
    g.setStroke(new BasicStroke(2.0f, BasicStroke.CAP_ROUND,BasicStroke.JOIN_ROUND));
    g.setPaint(Gray._30);
    g.drawLine(4, 7, 7, 10);
    g.drawLine(7, 10, sz, 2);
    g.setPaint(Gray._170);
    g.drawLine(4, 5, 7, 8);
    g.drawLine(7, 8, sz, 0);
  }

  g.translate(-lr.getCheckRect().x-2, -lr.getCheckRect().y-2);
  config.restore();
  g.setColor(foreground);
}
 
开发者ID:bulenkov,项目名称:Darcula,代码行数:36,代码来源:DarculaCheckBoxMenuItemUI.java

示例7: paint

import com.bulenkov.iconloader.util.Gray; //导入依赖的package包/类
@Override
public void paint(Graphics g2, JComponent c) {
  final Graphics2D g = (Graphics2D)g2;
  final GraphicsConfig config = new GraphicsConfig(g);
  final Color bg = c.getBackground();
  g.setPaint(new GradientPaint(0, 0, ColorUtil.shift(bg, 1.4), 0, c.getHeight(), ColorUtil.shift(bg, 0.9)));
  final int h = c.getHeight();
  final int w = c.getWidth();
  g.fillRect(0,0, w, h);
  g.setPaint(ColorUtil.shift(bg, 0.75));
  g.drawLine(0, h-1, w, h-1);
  g.drawLine(w-1, 0, w-1, h-1);

  final Enumeration<TableColumn> columns = ((JTableHeader)c).getColumnModel().getColumns();

  final Color lineColor = ColorUtil.shift(bg, 0.7);
  final Color shadow = Gray._255.withAlpha(30);
  int offset = 0;
  while (columns.hasMoreElements()) {
    final TableColumn column = columns.nextElement();
    if (columns.hasMoreElements() && column.getWidth() > 0) {
      offset += column.getWidth();
      g.setColor(lineColor);
      g.drawLine(offset-1, 1, offset-1, h-3);
      g.setColor(shadow);
      g.drawLine(offset, 1, offset, h-3);
    }
  }

  config.restore();

  super.paint(g, c);
}
 
开发者ID:bulenkov,项目名称:Darcula,代码行数:34,代码来源:DarculaTableHeaderUI.java

示例8: mouseEntered

import com.bulenkov.iconloader.util.Gray; //导入依赖的package包/类
@Override
public void mouseEntered(MouseEvent e)
{
	if (isEnabled())
		setBackground(Gray._90);
}
 
开发者ID:alessandrojean,项目名称:manga-no-keiei,代码行数:7,代码来源:SimpleVolumeCard.java

示例9: mouseEntered

import com.bulenkov.iconloader.util.Gray; //导入依赖的package包/类
@Override
public void mouseEntered(MouseEvent e)
{
	setBackground(Gray._90);
}
 
开发者ID:alessandrojean,项目名称:manga-no-keiei,代码行数:6,代码来源:VolumeCard.java

示例10: getInactiveFillColor

import com.bulenkov.iconloader.util.Gray; //导入依赖的package包/类
protected Color getInactiveFillColor() {
  return getColor("inactiveFillColor", Gray._40.withAlpha(180));
}
 
开发者ID:bulenkov,项目名称:Darcula,代码行数:4,代码来源:DarculaCheckBoxUI.java

示例11: getBorderColor1

import com.bulenkov.iconloader.util.Gray; //导入依赖的package包/类
protected Color getBorderColor1(boolean enabled) {
  return enabled ? getColor("borderColor1", Gray._120.withAlpha(0x5a))
                 : getColor("disabledBorderColor1", Gray._120.withAlpha(90));
}
 
开发者ID:bulenkov,项目名称:Darcula,代码行数:5,代码来源:DarculaCheckBoxUI.java

示例12: getBorderColor2

import com.bulenkov.iconloader.util.Gray; //导入依赖的package包/类
protected Color getBorderColor2(boolean enabled) {
  return enabled ? getColor("borderColor2", Gray._105.withAlpha(90))
                 : getColor("disabledBorderColor2", Gray._105.withAlpha(90));
}
 
开发者ID:bulenkov,项目名称:Darcula,代码行数:5,代码来源:DarculaCheckBoxUI.java

示例13: getBackgroundColor1

import com.bulenkov.iconloader.util.Gray; //导入依赖的package包/类
protected Color getBackgroundColor1() {
  return getColor("backgroundColor1", Gray._110);
}
 
开发者ID:bulenkov,项目名称:Darcula,代码行数:4,代码来源:DarculaCheckBoxUI.java

示例14: getBackgroundColor2

import com.bulenkov.iconloader.util.Gray; //导入依赖的package包/类
protected Color getBackgroundColor2() {
  return getColor("backgroundColor2", Gray._95);
}
 
开发者ID:bulenkov,项目名称:Darcula,代码行数:4,代码来源:DarculaCheckBoxUI.java

示例15: getCheckSignColor

import com.bulenkov.iconloader.util.Gray; //导入依赖的package包/类
protected Color getCheckSignColor(boolean enabled) {
  return enabled ? getColor("checkSignColor", Gray._170)
                 : getColor("checkSignColorDisabled", Gray._120);
}
 
开发者ID:bulenkov,项目名称:Darcula,代码行数:5,代码来源:DarculaCheckBoxUI.java


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