46474849505152535455
Graphics2D g2 = image.createGraphics(); g2.setColor(new Color(255,0,0,0)); g2.fillRect(0, 0, 22, 22); g2.setColor(getForeground()); g2.drawLine(0, 11, 22, 11); setIcon(new ImageIcon(image)); } }
48114812481348144815481648174818481948204821
m_oldX = m_startX; m_oldY = m_startY; Graphics2D gx = (Graphics2D)m_beanLayout.getGraphics(); gx.setXORMode(java.awt.Color.white); gx.drawLine(m_startX, m_startY, m_startX, m_startY); gx.dispose(); m_mode = CONNECTING; } } }
186187188189190191192193194195196
//Rectangle oldBounds = getBounds(); g2d.setColor(gridColor); // vertical lines for (int x = 1; x < visibleDays + 1; x++) { g2d.drawLine(x * dayWidth, 0, x * dayWidth, getHoursPerDay() * hourWidth); } // horizontal lines int xEnd = visibleDays * dayWidth; for (int y = 1; y < getHoursPerDay() + 1; y++) {
192193194195196197198199200201202
} // horizontal lines int xEnd = visibleDays * dayWidth; for (int y = 1; y < getHoursPerDay() + 1; y++) { g2d.drawLine(0, y * hourWidth, xEnd, y * hourWidth); } RoundBox selectedBox = null; DateTime startDate = settings.getStartDate(); // paint events
22512252225322542255225622572258225922602261
} if (getModel().isRollover()) { g2.setColor(Color.MAGENTA); } int delta = 6; g2.drawLine(delta, delta, getWidth() - delta - 1, getHeight() - delta - 1); g2.drawLine(getWidth() - delta - 1, delta, delta, getHeight() - delta - 1); g2.dispose(); } } }
22522253225422552256225722582259226022612262
if (getModel().isRollover()) { g2.setColor(Color.MAGENTA); } int delta = 6; g2.drawLine(delta, delta, getWidth() - delta - 1, getHeight() - delta - 1); g2.drawLine(getWidth() - delta - 1, delta, delta, getHeight() - delta - 1); g2.dispose(); } } }
202203204205206207208209210211212
{ if (gfx instanceof Graphics2D) { Graphics2D graphics2D = (Graphics2D) gfx; graphics2D.setStroke(value); graphics2D.drawLine(box.x, box.height / 2 + box.y, box.x + box.width, box.height / 2 + box.y); } } /* (non-Javadoc) * @see java.beans.PropertyEditor#getJavaInitializationString()
451452453454455456457458459460461
Color origColor = g2d.getColor(); Shape origClip = g2d.getClip(); g2d.setStroke(sampleValue); g2d.drawLine(getInsets().left + 1, (getHeight() / 2) + 1, getWidth() - (getInsets().right + 1), (getHeight() / 2) + 1); g2d.setClip(origClip); g2d.setStroke(origStroke); g2d.setColor(origColor); }
494495496497498499500501502503504
g2d.translate(x, y); g2d.setColor(Color.BLACK); g2d.setStroke(basicStroke); g2d.drawLine(0, getIconHeight() / 2, getIconWidth(), getIconHeight() / 2); g2d.setColor(origColor); g2d.translate(-x, -y); g2d.setStroke(origStroke); g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, hint);
5455565758596061626364
public void draw(Graphics g, Point2D[] points, boolean complete) { Graphics2D g2D = (Graphics2D) g; setGraphics(g2D); // we just need to draw the poly line for (int i = 0; i < points.length - 1; i++) g2D.drawLine((int) points[i].getX(), (int) points[i].getY(), (int) points[i + 1].getX(), (int) points[i + 1].getY()); restoreGraphics(g2D); }