Search in sources :

Example 1 with IconicDelegate

use of com.archimatetool.editor.diagram.figures.IconicDelegate in project archi by archimatetool.

the class NoteFigure method setUI.

@Override
protected void setUI() {
    setLayoutManager(new GridLayout());
    FlowPage page = new FlowPage();
    fTextFlow = new TextFlow();
    fTextFlow.setLayoutManager(new ParagraphTextLayout(fTextFlow, ParagraphTextLayout.WORD_WRAP_SOFT));
    page.add(fTextFlow);
    setOpaque(true);
    GridData gd = new GridData(SWT.LEFT, SWT.TOP, true, true);
    add(page, gd);
    fTextPositionDelegate = new TextPositionDelegate(this, page, getDiagramModelObject());
    setIconicDelegate(new IconicDelegate(getDiagramModelObject()));
}
Also used : GridLayout(org.eclipse.draw2d.GridLayout) FlowPage(org.eclipse.draw2d.text.FlowPage) IconicDelegate(com.archimatetool.editor.diagram.figures.IconicDelegate) GridData(org.eclipse.draw2d.GridData) TextFlow(org.eclipse.draw2d.text.TextFlow) TextPositionDelegate(com.archimatetool.editor.diagram.figures.TextPositionDelegate) ParagraphTextLayout(org.eclipse.draw2d.text.ParagraphTextLayout)

Example 2 with IconicDelegate

use of com.archimatetool.editor.diagram.figures.IconicDelegate in project archi by archimatetool.

the class IconSection method refreshPreviewImage.

private void refreshPreviewImage() {
    // Check also if the selected object has been orphaned in case the Properties View is still showing the object if it has the focus
    if (isAlive(getFirstSelectedObject())) {
        disposeImage();
        // Use an IconicDelegate to create the image which may come from the object or via a profile image
        IconicDelegate iconicDelegate = new IconicDelegate((IIconic) getFirstSelectedObject());
        iconicDelegate.updateImage();
        fImage = iconicDelegate.getImage();
        fCanvas.redraw();
    }
}
Also used : IconicDelegate(com.archimatetool.editor.diagram.figures.IconicDelegate)

Example 3 with IconicDelegate

use of com.archimatetool.editor.diagram.figures.IconicDelegate in project archi by archimatetool.

the class CanvasBlockFigure method setUI.

@Override
protected void setUI() {
    setLayoutManager(new DelegatingLayout());
    Locator mainLocator = new Locator() {

        @Override
        public void relocate(IFigure target) {
            Rectangle bounds = getBounds().getCopy();
            translateFromParent(bounds);
            target.setBounds(bounds);
        }
    };
    FlowPage flowPage = new FlowPage();
    fTextFlow = new TextFlow();
    fTextFlow.setLayoutManager(new ParagraphTextLayout(fTextFlow, ParagraphTextLayout.WORD_WRAP_HARD));
    flowPage.add(fTextFlow);
    Figure textWrapperFigure = new Figure();
    textWrapperFigure.setLayoutManager(new GridLayout());
    textWrapperFigure.add(flowPage, new GridData(SWT.CENTER, SWT.CENTER, true, true));
    add(textWrapperFigure, mainLocator);
    fTextPositionDelegate = new TextPositionDelegate(textWrapperFigure, flowPage, getDiagramModelObject());
    // This last
    add(getMainFigure(), mainLocator);
    setIconicDelegate(new IconicDelegate(getDiagramModelObject(), MAX_ICON_SIZE));
}
Also used : Locator(org.eclipse.draw2d.Locator) FlowPage(org.eclipse.draw2d.text.FlowPage) GridLayout(org.eclipse.draw2d.GridLayout) DelegatingLayout(org.eclipse.draw2d.DelegatingLayout) IconicDelegate(com.archimatetool.editor.diagram.figures.IconicDelegate) Rectangle(org.eclipse.draw2d.geometry.Rectangle) GridData(org.eclipse.draw2d.GridData) TextFlow(org.eclipse.draw2d.text.TextFlow) TextPositionDelegate(com.archimatetool.editor.diagram.figures.TextPositionDelegate) ParagraphTextLayout(org.eclipse.draw2d.text.ParagraphTextLayout) IFigure(org.eclipse.draw2d.IFigure) IFigure(org.eclipse.draw2d.IFigure) AbstractContainerFigure(com.archimatetool.editor.diagram.figures.AbstractContainerFigure) Figure(org.eclipse.draw2d.Figure) ITextFigure(com.archimatetool.editor.diagram.figures.ITextFigure)

Example 4 with IconicDelegate

use of com.archimatetool.editor.diagram.figures.IconicDelegate in project archi by archimatetool.

the class CanvasStickyFigure method setUI.

@Override
protected void setUI() {
    setLayoutManager(new GridLayout());
    FlowPage flowPage = new FlowPage();
    fTextFlow = new TextFlow();
    fTextFlow.setLayoutManager(new ParagraphTextLayout(fTextFlow, ParagraphTextLayout.WORD_WRAP_HARD));
    flowPage.add(fTextFlow);
    add(flowPage, new GridData(SWT.CENTER, SWT.CENTER, true, true));
    fTextPositionDelegate = new TextPositionDelegate(this, flowPage, getDiagramModelObject());
    setIconicDelegate(new IconicDelegate(getDiagramModelObject(), MAX_ICON_SIZE));
}
Also used : GridLayout(org.eclipse.draw2d.GridLayout) FlowPage(org.eclipse.draw2d.text.FlowPage) IconicDelegate(com.archimatetool.editor.diagram.figures.IconicDelegate) GridData(org.eclipse.draw2d.GridData) TextFlow(org.eclipse.draw2d.text.TextFlow) TextPositionDelegate(com.archimatetool.editor.diagram.figures.TextPositionDelegate) ParagraphTextLayout(org.eclipse.draw2d.text.ParagraphTextLayout)

Aggregations

IconicDelegate (com.archimatetool.editor.diagram.figures.IconicDelegate)4 TextPositionDelegate (com.archimatetool.editor.diagram.figures.TextPositionDelegate)3 GridData (org.eclipse.draw2d.GridData)3 GridLayout (org.eclipse.draw2d.GridLayout)3 FlowPage (org.eclipse.draw2d.text.FlowPage)3 ParagraphTextLayout (org.eclipse.draw2d.text.ParagraphTextLayout)3 TextFlow (org.eclipse.draw2d.text.TextFlow)3 AbstractContainerFigure (com.archimatetool.editor.diagram.figures.AbstractContainerFigure)1 ITextFigure (com.archimatetool.editor.diagram.figures.ITextFigure)1 DelegatingLayout (org.eclipse.draw2d.DelegatingLayout)1 Figure (org.eclipse.draw2d.Figure)1 IFigure (org.eclipse.draw2d.IFigure)1 Locator (org.eclipse.draw2d.Locator)1 Rectangle (org.eclipse.draw2d.geometry.Rectangle)1