IDiagramViewManager diagramViewManager = api.getViewManager().getDiagramViewManager();
IDiagram currentDiagram = diagramViewManager.getCurrentDiagram();
IDiagramViewManager diagramViewManager = api.getViewManager().getDiagramViewManager();
List<IPresentation> iPresentationList = Arrays.asList(diagramViewManager.getSelectedPresentations());
Exemple: imp est INodePresentation. Je me demande si je peux y aller s'il est dérivé de IPresentation.
inp.setProperty(Key.FONT_COLOR, "#FF0000");
package xyz.astah.example;
import java.awt.Frame;
import java.awt.Insets;
import javax.swing.JDialog;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
public class TextDialog extends JDialog {
public TextDialog(String text, Frame frame, int width, int height, boolean modal) {
super(frame, "Text Dialog", modal);
JTextArea jTextArea = new JTextArea(text);
jTextArea.setMargin(new Insets(8, 8, 8, 8));
JScrollPane jScrollPane = new JScrollPane(jTextArea);
this.getContentPane().add(jScrollPane);
this.setBounds(frame.getX() + 100, frame.getY() + 100, width, height);
this.setVisible(true);
}
}
Exemple d'utilisation
TextDialog textDialog = new TextDialog(outputText.toString(), api.getViewManager().getMainFrame(), 300, 300, false);