Search in sources :

Example 6 with Fragment

use of net.sf.sdedit.drawable.Fragment in project abstools by abstools.

the class FragmentManager method openFragments.

/**
 * Creates {@linkplain Fragment} objects for all pending fragment labels in
 * {@linkplain #getFragmentLabels()} and adds them to the list of open
 * fragments.
 */
public void openFragments() {
    finishFragments();
    for (String fragment : fragmentLabels) {
        if (fragment.startsWith("[c")) {
            fragment = fragment.substring(2, fragment.length() - 1).trim();
        }
        if (fragment.length() > 0 && fragment.charAt(0) == ':') {
            fragment = fragment.substring(1);
            int s = fragment.indexOf(' ');
            if (s == -1) {
                openFragment(fragment, "");
            } else {
                String type = fragment.substring(0, s);
                String name = fragment.substring(s + 1);
                openFragment(type, name);
            }
        } else {
            openFragment("", fragment);
        }
    }
    if (fragmentSectionLabel != null) {
        Fragment recent = getRecentFragment();
        if (recent != null) {
            recent.addSection(fragmentSectionLabel);
        }
    }
}
Also used : Fragment(net.sf.sdedit.drawable.Fragment)

Aggregations

Fragment (net.sf.sdedit.drawable.Fragment)6 Point (java.awt.Point)1 JPanel (javax.swing.JPanel)1 Arrow (net.sf.sdedit.drawable.Arrow)1 Drawable (net.sf.sdedit.drawable.Drawable)1 ExtensibleDrawable (net.sf.sdedit.drawable.ExtensibleDrawable)1 Text (net.sf.sdedit.drawable.Text)1 SyntaxError (net.sf.sdedit.error.SyntaxError)1