Boas Pessoal, alguem me dá uma dica para por o metodo com um formato de hora (hh:mm), para inserir neste metodo.
public void setRulerValues(
double Min_Arg,
double Max_Arg) {
int SegmentCount = Ctrl.getSegmentCount();
if (SegmentCount == 0) {
SegmentCount = 1;
}
RulerWidth = JComponent1.getSize().height - MARGIN_RULER_LEFT - MARGIN_RULER_RIGHT;
GraduationWidth = (RulerWidth * Ctrl.getSegmentSize()) / (Ctrl.getMaximumValue() - Ctrl.getMinimumValue());
NeverDrawn = false;
int NewLeftValue = (int)(MARGIN_RULER_LEFT + ((Min_Arg - Ctrl.getMinimumValue()) * RulerWidth) / (Ctrl.getMaximumValue() - Ctrl.getMinimumValue()));
int NewRightValue = (int)(MARGIN_RULER_LEFT + ((Max_Arg - Ctrl.getMinimumValue()) * RulerWidth) / (Ctrl.getMaximumValue() - Ctrl.getMinimumValue()));
if (NewLeftValue <= NewRightValue && NewLeftValue >= MARGIN_RULER_LEFT && NewRightValue <= MARGIN_RULER_LEFT + RulerWidth) {
LeftValue = NewLeftValue;
RightValue = NewRightValue;
int TriangleSide = RulerHeight / 2;
TriangleSide = Math.max(Math.min(TriangleSide, 20), 10);
if (UIManager.getLookAndFeel().getName().equals("Metal")) {
int[] xp1 = {LeftValue, LeftValue-7, LeftValue-7, LeftValue-6, LeftValue+6, LeftValue+7, LeftValue+7};
int[] yp1 = {Margin_Ruler_Top + RulerHeight + 1-14,
Margin_Ruler_Top + RulerHeight + 1-7, Margin_Ruler_Top + RulerHeight +1, Margin_Ruler_Top + RulerHeight + 1+1,
Margin_Ruler_Top + RulerHeight + 1+1, Margin_Ruler_Top + RulerHeight +1, Margin_Ruler_Top + RulerHeight + 1-7};
TheLeft_Polygon = new Polygon(xp1, yp1, 7);
int[] xp2 = {RightValue-7, RightValue-7, RightValue-6, RightValue+6, RightValue+7, RightValue+7, RightValue};
int[] yp2 = {Margin_Ruler_Top - 1+7, Margin_Ruler_Top - 1, Margin_Ruler_Top - 1-1,
Margin_Ruler_Top - 1-1, Margin_Ruler_Top - 1, Margin_Ruler_Top - 1+7,
Margin_Ruler_Top - 1+14,};
TheRight_Polygon = new Polygon(xp2, yp2, 7);
} else { // Triangles by default
TheLeft_Polygon = new Polygon();
TheLeft_Polygon.addPoint(LeftValue , Margin_Ruler_Top + RulerHeight - RulerHeight/2 - 1);
TheLeft_Polygon.addPoint(LeftValue + RulerHeight/2 + 2, Margin_Ruler_Top + RulerHeight + 1);
TheLeft_Polygon.addPoint(LeftValue , Margin_Ruler_Top + RulerHeight + 1);
TheLeft_Polygon.addPoint(LeftValue , Margin_Ruler_Top + RulerHeight - RulerHeight/2 - 1);
TheRight_Polygon = new Polygon();
TheRight_Polygon.addPoint(RightValue - 2 - RulerHeight/2, Margin_Ruler_Top - 1);
TheRight_Polygon.addPoint(RightValue , Margin_Ruler_Top - 1);
TheRight_Polygon.addPoint(RightValue , Margin_Ruler_Top + RulerHeight/2 + 1);
TheRight_Polygon.addPoint(RightValue - 2 - RulerHeight/2, Margin_Ruler_Top - 1);
}
} else if (Ctrl.getSize().width == 0 || Ctrl.getSize().height == 0) {
} else {
System.err.println("\nsetRulerValues()");
System.err.println(" Size = " + Ctrl.getSize());
System.err.println(" NewLeftValue = " + NewLeftValue);
System.err.println(" NewRightValue = " + NewRightValue);
System.err.println(" MARGIN_RULER_LEFT = " + MARGIN_RULER_LEFT);
System.err.println(" MARGIN_RULER_LEFT + RulerWidth = " + (MARGIN_RULER_LEFT + RulerWidth));
//Debug.debug(0, "");
}
} // setRulerValues()