Changeset 368
- Timestamp:
- 10/11/08 16:40:26 (16 years ago)
- Location:
- trunk/src_apollo/org/apollo
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src_apollo/org/apollo/gui/TimeAxis.java
r355 r368 25 25 public static final Font TIME_BAR_FONT = new Font("Arial", Font.PLAIN, 14); 26 26 private static final Stroke TICK_STROKE = Strokes.SOLID_1; 27 28 private static final Color MAJOR_TICK_COLOR = Color.BLACK; 29 private static final Color MINOR_TICK_COLOR = new Color(0.4f, 0.4f, 0.4f); 27 30 28 31 private static final int DESIRED_MAJOR_TICK_PIXEL_SPACING = 100; … … 210 213 211 214 // Skip major positions 212 if (((tx - majorTickXStart) % majorTickPixelSpacing) == 0)215 if (((tx - majorTickXStart) % majorTickPixelSpacing) <= 4) // could be a pixel out 213 216 tx += minorTickPixelSpacing; 214 217 … … 311 314 public void paint(Graphics g, int x, int y, int height, Color backgroundColor) { 312 315 313 if (majorTickXPositions == null) return;314 315 316 int majorTickHeight = height / 2; 316 317 int minorTickHeight = height / 4; … … 321 322 322 323 g.setFont(TIME_BAR_FONT); 323 g.setColor(Color.BLACK);324 ((Graphics2D)g).setStroke(TICK_STROKE);325 326 if (majorTickLabels != null) {327 328 324 325 if (majorTickXPositions != null) { 326 327 ((Graphics2D)g).setStroke(TICK_STROKE); 328 329 g.setColor(MAJOR_TICK_COLOR); 329 330 // Draw Major ticks and labels 330 331 for (int i = 0; i < majorTickLabels.length; i++) { … … 344 345 345 346 } 347 348 g.setColor(MINOR_TICK_COLOR); 346 349 347 350 // Draw minor ticks … … 358 361 } else if (alternateLabel != null) { 359 362 363 g.setColor(Color.BLACK); 364 360 365 FontMetrics fm = g.getFontMetrics(TIME_BAR_FONT); 361 366 Rectangle2D rect = fm.getStringBounds(alternateLabel, g);
Note:
See TracChangeset
for help on using the changeset viewer.