Package edu.mit.csail.sdg.alloy4

Examples of edu.mit.csail.sdg.alloy4.OurCheckbox


                     +"Some warnings can affect the soundness of the analysis.\n"
                     +"To proceed despite the warnings, go to the Options menu.\n");
                }
            }
            if (array[0].equals("warning")) {
                ErrorWarning e = (ErrorWarning)(array[1]);
                if (!warnings.add(e)) return;
                Pos p=e.pos;
                span.logLink("Warning #"+warnings.size(), "POS: "+p.x+" "+p.y+" "+p.x2+" "+p.y2+" "+p.filename);
                span.log("\n"); span.logIndented(e.msg.trim()); span.log("\n\n");
            }
View Full Code Here


        commands=null;
        if (text==null) return null; // If this was called prior to the "text" being fully 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>"));
View Full Code Here

            toolbar.add(runbutton=OurUtil.button("Execute", "Executes the latest command", "images/24_execute.gif", doExecuteLatest()));
            toolbar.add(stopbutton=OurUtil.button("Stop", "Stops the current analysis", "images/24_execute_abort2.gif", doStop(2)));
            stopbutton.setVisible(false);
            toolbar.add(showbutton=OurUtil.button("Show", "Shows the latest instance", "images/24_graph.gif", doShowLatest()));
            toolbar.add(Box.createHorizontalGlue());
            toolbar.setBorder(new OurBorder(false,false,false,false));
        } finally {
            wrap = false;
        }

        // Choose the antiAlias setting
        OurAntiAlias.enableAntiAlias(AntiAlias.get());

        // Create the message area
        logpane = OurUtil.scrollpane(null);
        log = new SwingLogPanel(logpane, fontName, fontSize, background, Color.BLACK, new Color(.7f,.2f,.2f), this);

        // Create the text area
        text = new OurTabbedSyntaxWidget(fontName, fontSize, TabSize.get());
        text.listeners.add(this);
        text.enableSyntax(! SyntaxDisabled.get());

        // Add everything to the frame, then display the frame
        Container all=frame.getContentPane();
        all.setLayout(new BorderLayout());
        all.removeAll();
        JPanel lefthalf=new JPanel();
        lefthalf.setLayout(new BorderLayout());
        lefthalf.add(toolbar, BorderLayout.NORTH);
        text.addTo(lefthalf, BorderLayout.CENTER);
        splitpane = OurUtil.splitpane(JSplitPane.HORIZONTAL_SPLIT, lefthalf, logpane, width/2);
        splitpane.setResizeWeight(0.5D);
        status = OurUtil.make(OurAntiAlias.label(" "), new Font(fontName, Font.PLAIN, fontSize), Color.BLACK, background);
        status.setBorder(new OurBorder(true,false,false,false));
        all.add(splitpane, BorderLayout.CENTER);
        all.add(status, BorderLayout.SOUTH);

        // Generate some informative log messages
        log.logBold("Alloy Analyzer "+Version.version()+" (build date: "+Version.buildDate()+")\n\n");
View Full Code Here

         if (obj==null && value==null) return;
         Object old = map.put(obj, value);
         if ((old==null && value!=null) || (old!=null && !old.equals(value))) change();
      }
      OurCheckbox pick(String label, String tooltip) {
         return new OurCheckbox(label, tooltip, (Boolean.TRUE.equals(get(null)) ? OurCheckbox.ON : OurCheckbox.OFF)) {
            private static final long serialVersionUID = 0;
            public Icon do_action() {
               T old = get(null);
               boolean ans = (old!=null && old.equals(onValue));
               MMap.this.put(null, ans ? offValue : onValue);
View Full Code Here

         };
      }
      OurCheckbox pick(final AlloyElement obj, final String label, final String tooltip) {
         T a = get(obj), b = resolve(obj);
         Icon icon = a==null ? (Boolean.TRUE.equals(b) ? OurCheckbox.INH_ON : OurCheckbox.INH_OFF) : (Boolean.TRUE.equals(a) ? OurCheckbox.ALL_ON : OurCheckbox.ALL_OFF);
         return new OurCheckbox(label, tooltip, icon) {
            private static final long serialVersionUID = 0;
            public Icon do_action() {
               T a = get(obj);
               if (a==null) a=onValue; else if (a.equals(onValue)) a=offValue; else a=null;
               MMap.this.put(obj, a);
View Full Code Here

         JPanel vis = vizState.nodeVisible    .pick(elt, "Show",                   "Display members as nodes");
         JPanel con = vizState.hideUnconnected.pick(elt, "Hide unconnected nodes", "Hide nodes without arcs");
         JPanel num = vizState.number         .pick(elt, "Number nodes",           "Attach atom number to node label as suffix");
         JPanel proj = null;
         if (vizState.canProject((AlloyType)elt))
            proj = new OurCheckbox("Project over this sig", "Click here to " + (enabled?"":"un") + "project over this signature", enabled ? OurCheckbox.ALL_OFF : OurCheckbox.ALL_ON) {
            private static final long serialVersionUID = 0;
            public Icon do_action() {
               if (enabled) projectAlloyType((AlloyType)elt); else deprojectAlloyType((AlloyType)elt);
               lastElement = elt;
               return enabled ? ALL_ON : ALL_OFF;
View Full Code Here

      JComboBox edgepal = new OurCombobox(false, DotPalette.values(), 100, 32, vizState.getEdgePalette()) {
         private static final long serialVersionUID = 0;
         @Override public String do_getText(Object value) { return ((DotPalette)value).getDisplayedText(); }
         @Override public void   do_changed(Object value) { vizState.setEdgePalette((DotPalette)value); }
      };
      JPanel name = new OurCheckbox("", "Whether the visualizer should use the original atom names as-is.", vizState.useOriginalName() ? OurCheckbox.ON : OurCheckbox.OFF) {
         private static final long serialVersionUID = 0;
         public Icon do_action() { boolean x = vizState.useOriginalName();  vizState.useOriginalName(!x); return (!x ? ON : OFF); }
      };
      JPanel priv = new OurCheckbox("", "Whether the visualizer should hide private sigs, sets, and relations by default.", vizState.hidePrivate() ? OurCheckbox.ON : OurCheckbox.OFF) {
         private static final long serialVersionUID = 0;
         public Icon do_action() { boolean x = vizState.hidePrivate();  vizState.hidePrivate(!x); remakeAll(); return (!x ? ON : OFF); }
      };
      JPanel meta = new OurCheckbox("", "Whether the visualizer should hide meta sigs, sets, and relations by default.", vizState.hideMeta() ? OurCheckbox.ON : OurCheckbox.OFF) {
         private static final long serialVersionUID = 0;
         public Icon do_action() { boolean x = vizState.hideMeta();  vizState.hideMeta(!x); remakeAll(); return (!x ? ON : OFF); }
      };
      parent.add(makelabel(" General Graph Settings:"));
      parent.add(OurUtil.makeH(wcolor, new Dimension(6, 6)));
View Full Code Here

        final String JAR = Util.jarPrefix();
        String alloytxt;
        try { alloytxt = Util.readAll(JAR + "LICENSES" + File.separator + "Alloy.txt"); } catch(IOException ex) { return null; }
        final JTextArea text = OurUtil.textarea(alloytxt, 15, 85, false, false, new EmptyBorder(2, 2, 2, 2), new Font("Monospaced", Font.PLAIN, 12));
        final JScrollPane scroll = OurUtil.scrollpane(text, new LineBorder(Color.DARK_GRAY, 1));
        final JComboBox combo = new OurCombobox(new String[]{"Alloy","Kodkod","JavaCup","SAT4J","ZChaff","MiniSat"}) {
            private static final long serialVersionUID = 0;
            @Override public void do_changed(Object value) {
              if (value instanceof String) {
                 try {
                     String content = Util.readAll(JAR + "LICENSES" + File.separator + value + ".txt");
View Full Code Here

    /** Updates the status bar at the bottom of the screen. */
    private Runner notifyChange() {
        if (wrap) return wrapMe();
        commands=null;
        if (text==null) return null; // If this was called prior to the "text" being fully 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;
    }
View Full Code Here

    /** This method performs Edit->FindNext. */
    private Runner doFindNext() {
        if (wrap) return wrapMe();
        if (lastFind.length()==0) return null;
        OurSyntaxWidget t = text.get();
        String all = t.getText();
        int i = Util.indexOf(all, lastFind, t.getCaret()+(lastFindForward?0:-1),lastFindForward,lastFindCaseSensitive);
        if (i<0) {
            i=Util.indexOf(all, lastFind, lastFindForward?0:(all.length()-1), lastFindForward, lastFindCaseSensitive);
            if (i<0) { log.logRed("The specified search string cannot be found."); return null; }
            log.logRed("Search wrapped.");
        } else {
            log.clearError();
        }
        if (lastFindForward) t.moveCaret(i, i+lastFind.length()); else t.moveCaret(i+lastFind.length(), i);
        t.requestFocusInWindow();
        return null;
    }
View Full Code Here

TOP

Related Classes of edu.mit.csail.sdg.alloy4.OurCheckbox

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.