本文整理汇总了Java中com.sun.hotspot.igv.data.GraphDocument类的典型用法代码示例。如果您正苦于以下问题:Java GraphDocument类的具体用法?Java GraphDocument怎么用?Java GraphDocument使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GraphDocument类属于com.sun.hotspot.igv.data包,在下文中一共展示了GraphDocument类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: actionPerformed
import com.sun.hotspot.igv.data.GraphDocument; //导入依赖的package包/类
@Override
public void actionPerformed(ActionEvent e) {
GraphDocument doc = new GraphDocument();
outer: for (FolderElement element : elements) {
Folder cur = element.getParent();
while (cur instanceof FolderElement) {
FolderElement curElement = (FolderElement) cur;
if (elements.contains(curElement)) {
continue outer;
}
cur = curElement.getParent();
}
Folder previousParent = element.getParent();
doc.addElement(element);
element.setParent(previousParent);
}
save(doc);
}
示例2: save
import com.sun.hotspot.igv.data.GraphDocument; //导入依赖的package包/类
public static void save(GraphDocument doc) {
JFileChooser fc = new JFileChooser();
fc.setFileFilter(ImportAction.getFileFilter());
fc.setCurrentDirectory(new File(Settings.get().get(Settings.DIRECTORY, Settings.DIRECTORY_DEFAULT)));
if (fc.showSaveDialog(null) == JFileChooser.APPROVE_OPTION) {
File file = fc.getSelectedFile();
if (!file.getName().contains(".")) {
file = new File(file.getAbsolutePath() + ".xml");
}
File dir = file;
if (!dir.isDirectory()) {
dir = dir.getParentFile();
}
Settings.get().put(Settings.DIRECTORY, dir.getAbsolutePath());
try {
try (Writer writer = new OutputStreamWriter(new FileOutputStream(file))) {
Printer p = new Printer();
p.export(writer, doc);
}
} catch (IOException e) {
JOptionPane.showMessageDialog(null, "Error writing file " + file.getAbsolutePath());
}
}
}
示例3: Server
import com.sun.hotspot.igv.data.GraphDocument; //导入依赖的package包/类
public Server(GraphDocument rootDocument, GroupCallback callback, boolean binary) {
this.binary = binary;
this.rootDocument = rootDocument;
this.callback = callback;
initializeNetwork();
Settings.get().addPreferenceChangeListener(this);
}
示例4: OutlineTopComponent
import com.sun.hotspot.igv.data.GraphDocument; //导入依赖的package包/类
private OutlineTopComponent() {
initComponents();
setName(NbBundle.getMessage(OutlineTopComponent.class, "CTL_OutlineTopComponent"));
setToolTipText(NbBundle.getMessage(OutlineTopComponent.class, "HINT_OutlineTopComponent"));
document = new GraphDocument();
initListView();
initToolbar();
initReceivers();
}
示例5: performAction
import com.sun.hotspot.igv.data.GraphDocument; //导入依赖的package包/类
@Override
protected void performAction(Node[] activatedNodes) {
GraphDocument doc = new GraphDocument();
for (Node n : activatedNodes) {
Group group = n.getLookup().lookup(Group.class);
doc.addElement(group);
}
save(doc);
}
示例6: OutlineTopComponent
import com.sun.hotspot.igv.data.GraphDocument; //导入依赖的package包/类
private OutlineTopComponent() {
initComponents();
setName(NbBundle.getMessage(OutlineTopComponent.class, "CTL_OutlineTopComponent"));
setToolTipText(NbBundle.getMessage(OutlineTopComponent.class, "HINT_OutlineTopComponent"));
document = new GraphDocument();
initListView();
initToolbar();
}
示例7: ServerPanel
import com.sun.hotspot.igv.data.GraphDocument; //导入依赖的package包/类
public ServerPanel(GraphDocument document) {
this.document = document;
Settings.get().addPreferenceChangeListener(preferenceChanged);
label = new JLabel();
label.setBorder(BorderFactory.createEmptyBorder(0, BORDER_SIZE, 0, BORDER_SIZE));
this.setLayout(new BorderLayout());
this.add(label, BorderLayout.WEST);
updateServer();
}
示例8: export
import com.sun.hotspot.igv.data.GraphDocument; //导入依赖的package包/类
public void export(Writer writer, GraphDocument document) {
XMLWriter xmlWriter = new XMLWriter(writer);
try {
export(xmlWriter, document);
} catch (IOException ex) {
}
}
示例9: parse
import com.sun.hotspot.igv.data.GraphDocument; //导入依赖的package包/类
public GraphDocument parse(XMLReader reader, InputSource source, XMLParser.ParseMonitor monitor) throws SAXException {
reader.setContentHandler(new XMLParser(xmlDocument, monitor));
try {
reader.parse(source);
} catch (IOException ex) {
throw new SAXException(ex);
}
return topHandler.getObject();
}
示例10: performAction
import com.sun.hotspot.igv.data.GraphDocument; //导入依赖的package包/类
protected void performAction(Node[] activatedNodes) {
GraphDocument doc = new GraphDocument();
for (Node n : activatedNodes) {
Group group = n.getLookup().lookup(Group.class);
doc.addGroup(group);
}
save(doc);
}
示例11: Client
import com.sun.hotspot.igv.data.GraphDocument; //导入依赖的package包/类
public Client(SocketChannel socket, GraphDocument rootDocument, GroupCallback callback, boolean binary) {
this.callback = callback;
this.socket = socket;
this.binary = binary;
this.rootDocument = rootDocument;
}
示例12: getDocument
import com.sun.hotspot.igv.data.GraphDocument; //导入依赖的package包/类
public GraphDocument getDocument() {
return document;
}