Package net.sf.latexdraw.glib.ui

Examples of net.sf.latexdraw.glib.ui.LCanvas$TooltipDisplayer


  @SuppressWarnings("unused")
  public void setUp() {
    View2DTK.setFactory(new LViewsFactory());
    IDrawing drawing = ShapeFactory.createDrawing();
    MLayeredPane layers = new MLayeredPane(false, false);
    canvas     = new LCanvas(drawing);
    LMagneticGrid grid = new LMagneticGrid(canvas);
    WidgetZoomer zoomer = new WidgetZoomer(canvas, true, true, null, "", null, "", true); //$NON-NLS-1$ //$NON-NLS-2$
    instrument   = new Pencil(canvas, new TextSetter(layers), layers);
    instrument.addEventable(canvas);
  }
View Full Code Here


  /**
   * The builder of the frame.
   * @since 3.0
   */
  private void buildFrame(final MProgressBar progressBar) {
    final LCanvas canvas   = getCanvas();
    final IDrawing drawing  = getDrawing();

    tabbedPanel = new MTabbedPane(true);

    layeredPanel = new MLayeredPane(false, false);
    layeredPanel.add(canvas.getScrollpane(), JLayeredPane.DEFAULT_LAYER);
    layeredPanel.addComponentsToResize(canvas.getScrollpane());

    if(progressBar!=null)
      progressBar.addToProgressBar(5);

    /* Creation of the rulers. */
    yScaleRuler = new YScaleRuler(canvas);
    xScaleRuler = new XScaleRuler(canvas, yScaleRuler);

    if(progressBar!=null)
      progressBar.addToProgressBar(5);

    /* Initialisation of the mapping between the model and the canvas. */
    MappingRegistry.REGISTRY.addMapping(new ShapeList2ViewListMapping(drawing.getShapes(), canvas.getViews(), canvas.getBorderInstrument()));
    MappingRegistry.REGISTRY.addMapping(new Drawing2CanvasMapping(drawing, canvas));
    MappingRegistry.REGISTRY.addMapping(new Selection2BorderMapping(drawing.getSelection().getShapes(), canvas.getBorderInstrument()));
    MappingRegistry.REGISTRY.addMapping(new Zoom2ScaleRuler(canvas.getZoomUnary(), xScaleRuler));
    MappingRegistry.REGISTRY.addMapping(new Zoom2ScaleRuler(canvas.getZoomUnary(), yScaleRuler));
    MappingRegistry.REGISTRY.addMapping(new Unit2ScaleRuler(ScaleRuler.getUnitSingleton(), xScaleRuler));
    MappingRegistry.REGISTRY.addMapping(new Unit2ScaleRuler(ScaleRuler.getUnitSingleton(), yScaleRuler));

    if(progressBar!=null)
      progressBar.addToProgressBar(5);
View Full Code Here


  @Override
  public void initialisePresentations() {
    final IDrawing drawing  = ShapeFactory.createDrawing();
    final LCanvas canvas  = new LCanvas(drawing);
    presentations.add(new Presentation<>(drawing, canvas));
    presentations.add(new Presentation<>(drawing, new LCodePanel(drawing, canvas)));
  }
View Full Code Here

  @Override
  public void compose(final MProgressBar progressBar) {
    widget = new MToolBar(true);

    final LCanvas canvas = frame.getCanvas();

    // Adding new/open/save buttons
    widget.add(frame.fileLoader.getNewButton());
    widget.add(frame.fileLoader.getLoadButton());
    widget.add(frame.fileLoader.getSaveButton());
View Full Code Here

  /**
   * Sets the eventable objects to the instruments.
   * @since 3.0
   */
  protected void setEventableToInstruments() {
    final LCanvas canvas   = widget.getCanvas();
    final MToolBar toolbar   = toolbarBuilder.getWidget();

    widget.prefActivator.addEventable(menubarBuilder.editMenu);
    widget.exceptionsManager.addEventable(toolbar);
    widget.scroller.addEventable(canvas);
View Full Code Here

  }


  @Override
  public void compose(final MProgressBar progressBar) {
    final LCanvas canvas = frame.getCanvas();
    final MetaShapeCustomiser metaShapeCustomiser = frame.getMetaShapeCustomiser();

    widget = new MPanel(false, true);
    widget.setLayout(new FlowLayout(FlowLayout.LEFT));
View Full Code Here

  private void applyValues() {
    final Exporter exporter         = frame.getExporter();
    final MagneticGridCustomiser gridCust   = frame.getGridCustomiser();
    final ScaleRulersCustomiser scaleCust   = frame.getScaleRulersCustomiser();
    final FileLoaderSaver saver       = frame.getFileLoader();
    final LCanvas canvas          = frame.getCanvas();
    final Dimension dim           = LSystem.INSTANCE.getScreenDimension();
    final Rectangle rec           = frame.getGraphicsConfiguration().getBounds();
    final GridStyle gridStyle;

    if(displayGridCB.isSelected())
       gridStyle = classicGridRB.isSelected() ? GridStyle.STANDARD : GridStyle.CUSTOMISED;
    else gridStyle = GridStyle.NONE;

    gridCust.grid.setStyle(gridStyle);
    gridCust.grid.setMagnetic(magneticGridCB.isSelected());
    gridCust.grid.setGridSpacing(Integer.parseInt(persoGridGapField.getValue().toString()));
    canvas.setAlphaInterpolation(alpaInterCheckBox.isSelected() ? RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY : RenderingHints.VALUE_ALPHA_INTERPOLATION_SPEED);
    canvas.setAntiAliasing(antialiasingCheckBox.isSelected() ? RenderingHints.VALUE_ANTIALIAS_ON : RenderingHints.VALUE_ANTIALIAS_OFF);
    canvas.setColorRendering(colorRenderCheckBox.isSelected() ? RenderingHints.VALUE_COLOR_RENDER_QUALITY : RenderingHints.VALUE_COLOR_RENDER_SPEED);
    canvas.setRendering(renderingCheckBox.isSelected() ? RenderingHints.VALUE_RENDER_QUALITY : RenderingHints.VALUE_RENDER_SPEED);
    exporter.setDefaultPackages(latexIncludes.getText());
    exporter.setPathExport(pathExportField.getText());
    gridCust.gridSpacing.setValueSafely(persoGridGapField.getValue());
    gridCust.magneticCB.setSelected(magneticGridCB.isSelected());
    gridCust.styleList.setSelectedItemSafely(gridStyle.getLabel());
View Full Code Here

TOP

Related Classes of net.sf.latexdraw.glib.ui.LCanvas$TooltipDisplayer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.