use of net.sf.latexdraw.models.interfaces.shape.PlottingStyle 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.PlottingStyle 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.PlottingStyle in project latexdraw by arnobl.
the class TestPencilAxesStyle method testSelectShowLabelsPencil.
@Test
public void testSelectShowLabelsPencil() {
new CompositeGUIVoidCommand(activatePencil, pencilCreatesAxes, updateIns).execute();
PlottingStyle style = showLabels.getSelectionModel().getSelectedItem();
selectPlotLabel.execute();
PlottingStyle newStyle = showLabels.getSelectionModel().getSelectedItem();
assertEquals(newStyle, ((IAxesProp) pencil.createShapeInstance()).getLabelsDisplayed());
assertNotEquals(style, newStyle);
}
use of net.sf.latexdraw.models.interfaces.shape.PlottingStyle in project latexdraw by arnobl.
the class TestHandAxeStyle method testSelectShowTicksSelection.
@Test
public void testSelectShowTicksSelection() {
new CompositeGUIVoidCommand(activateHand, selectionAddAxes, selectionAddRec, selectionAddAxes, updateIns).execute();
PlottingStyle style = showTicks.getSelectionModel().getSelectedItem();
selectPlotTicks.execute();
PlottingStyle newStyle = showTicks.getSelectionModel().getSelectedItem();
assertEquals(newStyle, ((IAxesProp) drawing.getSelection().getShapeAt(0)).getTicksDisplayed());
assertEquals(newStyle, ((IAxesProp) drawing.getSelection().getShapeAt(2)).getTicksDisplayed());
assertNotEquals(style, newStyle);
}
use of net.sf.latexdraw.models.interfaces.shape.PlottingStyle in project latexdraw by arnobl.
the class TestPencilAxesStyle method testSelectShowTicksPencil.
@Test
public void testSelectShowTicksPencil() {
new CompositeGUIVoidCommand(activatePencil, pencilCreatesAxes, updateIns).execute();
PlottingStyle style = showTicks.getSelectionModel().getSelectedItem();
selectPlotTicks.execute();
PlottingStyle newStyle = showTicks.getSelectionModel().getSelectedItem();
assertEquals(newStyle, ((IAxesProp) pencil.createShapeInstance()).getTicksDisplayed());
assertNotEquals(style, newStyle);
}
Aggregations