use of net.sf.latexdraw.models.interfaces.shape.TicksStyle in project latexdraw by arnobl.
the class GenericAxes method updatePathLabels.
default void updatePathLabels() {
final IAxes model = getModel();
// NON-NLS
final Font font = new Font("cmr10", model.getLabelsSize());
final PlottingStyle labelsDisplay = model.getLabelsDisplayed();
final PlottingStyle ticksDisplay = model.getTicksDisplayed();
final TicksStyle ticksStyle = model.getTicksStyle();
// This fake text is used to compute widths and heights and other font metrics of a current text.
// NON-NLS
final Text fooText = new Text("foo");
fooText.setFont(font);
if (labelsDisplay.isX()) {
updatePathLabelsX(ticksDisplay, ticksStyle, fooText);
}
if (labelsDisplay.isY()) {
updatePathLabelsY(ticksDisplay, ticksStyle, fooText);
}
}
use of net.sf.latexdraw.models.interfaces.shape.TicksStyle in project latexdraw by arnobl.
the class GenericAxes method updatePathTicks.
default void updatePathTicks() {
final IAxes model = getModel();
final PlottingStyle ticksDisplay = model.getTicksDisplayed();
final TicksStyle ticksStyle = model.getTicksStyle();
final double tickLgth = ticksStyle == TicksStyle.FULL ? model.getTicksSize() * 2d : model.getTicksSize();
if (ticksDisplay.isX()) {
updatePathTicksX(getGapX(), ticksStyle, tickLgth);
}
if (ticksDisplay.isY()) {
updatePathTicksY(getGapY(), ticksStyle, tickLgth);
}
disablePathTicks(!ticksDisplay.isX() && !ticksDisplay.isY());
setPathTicksFill(Color.BLACK);
}
use of net.sf.latexdraw.models.interfaces.shape.TicksStyle in project latexdraw by arnobl.
the class TestPencilAxesStyle method testSelectTicksStylePencil.
@Test
public void testSelectTicksStylePencil() {
new CompositeGUIVoidCommand(activatePencil, pencilCreatesAxes, updateIns).execute();
TicksStyle style = shapeTicks.getSelectionModel().getSelectedItem();
selectTicksStyle.execute();
TicksStyle newStyle = shapeTicks.getSelectionModel().getSelectedItem();
assertEquals(newStyle, ((IAxesProp) pencil.createShapeInstance()).getTicksStyle());
assertNotEquals(style, newStyle);
}
use of net.sf.latexdraw.models.interfaces.shape.TicksStyle in project latexdraw by arnobl.
the class TestHandAxeStyle method testSelectTicksStyleSelection.
@Test
public void testSelectTicksStyleSelection() {
new CompositeGUIVoidCommand(activateHand, selectionAddAxes, selectionAddRec, selectionAddAxes, updateIns).execute();
TicksStyle style = shapeTicks.getSelectionModel().getSelectedItem();
selectTicksStyle.execute();
TicksStyle newStyle = shapeTicks.getSelectionModel().getSelectedItem();
assertEquals(newStyle, ((IAxesProp) drawing.getSelection().getShapeAt(0)).getTicksStyle());
assertEquals(newStyle, ((IAxesProp) drawing.getSelection().getShapeAt(2)).getTicksStyle());
assertNotEquals(style, newStyle);
}
Aggregations