⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sugiyamalayoutcontroller.java

📁 用JGraph编的软件
💻 JAVA
字号:
// This file is part of the Echidna project
// (C) 2002 Forschungszentrum Informatik (FZI) Karlsruhe
// Please visit our website at http://echidna.sf.net
package org.jgraph.layout;

import java.util.Properties;
import javax.swing.JFrame;

/**
 * Responsible for administrating the SugiyamaLayoutAlgorithm.<br>
 *<br>
 *<br>
 * @author Sven Luzar
 * @version 1.0 init
 */
public class SugiyamaLayoutController implements LayoutController {

    public static final String KEY_HORIZONTAL_SPACING = "HorizontalSpacing";

    public static final String KEY_VERTICAL_SPACING   = "VerticalSpacing";

    private Properties properties;

    /**
     *
     */
    public SugiyamaLayoutController() {
       properties = new Properties();
       properties.put(KEY_HORIZONTAL_SPACING, "250");
       properties.put(KEY_VERTICAL_SPACING,   "150");
    }

    /**
     * Implementation.
     */
    public String toString() {
        return "Sugiyama";
    }

    /**
     * Implementation.
     */
    public boolean isConfigurable() {
        return true;
    }

    /**
     * Implementation.
     */
    public void configure() {

        SugiyamaLayoutConfigurationDialog dialog = new SugiyamaLayoutConfigurationDialog(new JFrame());
        dialog.setIndention(properties.getProperty(         KEY_HORIZONTAL_SPACING));
        dialog.setVerticalSpacing(properties.getProperty(   KEY_VERTICAL_SPACING));

        dialog.setVisible(true);
        if (dialog.canceled()) return;

        properties.put(KEY_HORIZONTAL_SPACING,  dialog.getIndention());
        properties.put(KEY_VERTICAL_SPACING,    dialog.getVerticalSpacing());
    }

    /**
     * Implementation.
     */
    public Properties getConfiguration() {
        return properties;
    }

    /**
     * Implementation.
     */
    public LayoutAlgorithm getLayoutAlgorithm() {
        return new SugiyamaLayoutAlgorithm();
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -