當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。