当前位置: 首页>>代码示例>>Java>>正文


Java GraphDocument类代码示例

本文整理汇总了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);
}
 
开发者ID:arodchen,项目名称:MaxSim,代码行数:21,代码来源:SaveAsAction.java

示例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());
        }
    }
}
 
开发者ID:arodchen,项目名称:MaxSim,代码行数:27,代码来源:SaveAsAction.java

示例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);
}
 
开发者ID:arodchen,项目名称:MaxSim,代码行数:8,代码来源:Server.java

示例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();
}
 
开发者ID:arodchen,项目名称:MaxSim,代码行数:12,代码来源:OutlineTopComponent.java

示例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);
}
 
开发者ID:arodchen,项目名称:MaxSim,代码行数:12,代码来源:SaveAsAction.java

示例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();
}
 
开发者ID:arodchen,项目名称:MaxSim,代码行数:11,代码来源:OutlineTopComponent.java

示例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();
    }
 
开发者ID:arodchen,项目名称:MaxSim,代码行数:11,代码来源:ServerPanel.java

示例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) {
        }
    }
 
开发者ID:ojdkbuild,项目名称:lookaside_java-1.8.0-openjdk,代码行数:10,代码来源:Printer.java

示例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();
}
 
开发者ID:ojdkbuild,项目名称:lookaside_java-1.8.0-openjdk,代码行数:11,代码来源:Parser.java

示例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);
    }
 
开发者ID:ojdkbuild,项目名称:lookaside_java-1.8.0-openjdk,代码行数:11,代码来源:SaveAsAction.java

示例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;
}
 
开发者ID:arodchen,项目名称:MaxSim,代码行数:7,代码来源:Client.java

示例12: getDocument

import com.sun.hotspot.igv.data.GraphDocument; //导入依赖的package包/类
public GraphDocument getDocument() {
    return document;
}
 
开发者ID:arodchen,项目名称:MaxSim,代码行数:4,代码来源:OutlineTopComponent.java


注:本文中的com.sun.hotspot.igv.data.GraphDocument类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。