Search in sources :

Example 6 with OurBorder

use of edu.mit.csail.sdg.alloy4.OurBorder in project org.alloytools.alloy by AlloyTools.

the class SimpleGUI method notifyChange.

/**
 * Updates the status bar at the bottom of the screen.
 */
private Runner notifyChange() {
    if (wrap)
        return wrapMe();
    commands = null;
    if (text == null)
        // If this was called prior to the "text" being fully
        return null;
    // initialized
    OurSyntaxWidget t = text.get();
    if (Util.onMac())
        frame.getRootPane().putClientProperty("windowModified", Boolean.valueOf(t.modified()));
    if (t.isFile())
        frame.setTitle(t.getFilename());
    else
        frame.setTitle("Alloy Analyzer " + Version.version());
    toolbar.setBorder(new OurBorder(false, false, text.count() <= 1, false));
    int c = t.getCaret();
    int y = t.getLineOfOffset(c) + 1;
    int x = c - t.getLineStartOffset(y - 1) + 1;
    status.setText("<html>&nbsp; Line " + y + ", Column " + x + (t.modified() ? " <b style=\"color:#B43333;\">[modified]</b></html>" : "</html>"));
    return null;
}
Also used : OurSyntaxWidget(edu.mit.csail.sdg.alloy4.OurSyntaxWidget) OurBorder(edu.mit.csail.sdg.alloy4.OurBorder)

Aggregations

OurBorder (edu.mit.csail.sdg.alloy4.OurBorder)6 JPanel (javax.swing.JPanel)3 JScrollPane (javax.swing.JScrollPane)3 BorderLayout (java.awt.BorderLayout)2 Font (java.awt.Font)2 ActionEvent (java.awt.event.ActionEvent)2 ActionListener (java.awt.event.ActionListener)2 FocusEvent (java.awt.event.FocusEvent)2 File (java.io.File)2 BooleanPref (edu.mit.csail.sdg.alloy4.A4Preferences.BooleanPref)1 ChoicePref (edu.mit.csail.sdg.alloy4.A4Preferences.ChoicePref)1 Pref (edu.mit.csail.sdg.alloy4.A4Preferences.Pref)1 StringPref (edu.mit.csail.sdg.alloy4.A4Preferences.StringPref)1 VerbosityPref (edu.mit.csail.sdg.alloy4.A4Preferences.VerbosityPref)1 Listener (edu.mit.csail.sdg.alloy4.Listener)1 OurConsole (edu.mit.csail.sdg.alloy4.OurConsole)1 OurSyntaxWidget (edu.mit.csail.sdg.alloy4.OurSyntaxWidget)1 OurTabbedSyntaxWidget (edu.mit.csail.sdg.alloy4.OurTabbedSyntaxWidget)1 OurTree (edu.mit.csail.sdg.alloy4.OurTree)1 VizGUI (edu.mit.csail.sdg.alloy4viz.VizGUI)1