Package lupos.gui.anotherSyntaxHighlighting

Examples of lupos.gui.anotherSyntaxHighlighting.LuposJTextPane


            FlowLayout.LEFT));
        infoPanel.add(info);
        pPanel.add(infoPanel, BorderLayout.NORTH);

        final LuposDocument document = new LuposDocument();
        final LuposJTextPane ta_prefixes = new LuposJTextPane(document);
        document.init(TurtleParser.createILuposParser(new LuposDocumentReader(document)), false);

        // just to get all prefixes before displaying them...
        for(QueryResult qr: resultQueryEvaluator){
          qr.toString(prefixInstance);
        }
        if(errorsInOntology!=null){
          errorsInOntology.toString(prefixInstance);
        }
       
        ta_prefixes.setText(prefixInstance.getPrefixString("", "").toString());
        ta_prefixes.setEditable(false);
        final JScrollPane scroll = new JScrollPane(ta_prefixes);
        pPanel.add(scroll, BorderLayout.CENTER);

        splitPane_result = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
        splitPane_result.setOneTouchExpandable(true);
View Full Code Here


          final Object[] row = new Object[max + 1];

          if (operatorGraph == null) {
            final LuposDocument document = new LuposDocument();
            final LuposJTextPane textPane = new LuposJTextPane(document);
            document.init(TurtleParser.createILuposParser(new LuposDocumentReader(document)), false);
            textPane.setText(p.getName().toString(prefixInstance));
            textPane.setEditable(false);
            row[0] = textPane;
          } else {
            row[0] = p.getName().toString(prefixInstance);
          }

          int index = 1;
          for (final Literal l : p.getParameters()) {
            if (operatorGraph == null) {
              final LuposDocument document = new LuposDocument();
              final LuposJTextPane textPane = new LuposJTextPane(document);
              document.init(TurtleParser.createILuposParser(new LuposDocumentReader(document)), false);
              textPane.setText(l.toString(prefixInstance));
              textPane.setEditable(false);

              row[index++] = textPane;
            } else {
              row[index++] = l.toString(prefixInstance);
            }
          }

          for (int i2 = index; i2 < max + 1; i2++) {
            row[i2] = "";
          }

          rows[i++] = row;
        }

        tablesJTable[indexJTables++] = generateTable(rows, tableHead,
            operatorGraph);
      } else if (qr instanceof GraphResult) {
        final GraphResult gr = (GraphResult) qr;

        final String[] tableHead = { "Subject", "Predicate", "Object" };

        final Object[][] rows = new Object[gr.getGraphResultTriples()
            .size()][];

        int i = 0;

        for (final Triple t : gr.getGraphResultTriples()) {
          if (operatorGraph == null) {
            final LuposDocument documentSubject = new LuposDocument();
            final LuposJTextPane textPaneSubject = new LuposJTextPane(documentSubject);
            documentSubject.init(TurtleParser.createILuposParser(new LuposDocumentReader(documentSubject)), false);
            textPaneSubject.setText(t.getSubject().toString(prefixInstance));
            textPaneSubject.setEditable(false);

            final LuposDocument documentPredicate = new LuposDocument();
            final LuposJTextPane textPanePredicate = new LuposJTextPane(documentPredicate);
            documentPredicate.init(TurtleParser.createILuposParser(new LuposDocumentReader(documentPredicate)), false);
            textPanePredicate.setText(t.getPredicate().toString(prefixInstance));
            textPanePredicate.setEditable(false);

            final LuposDocument documentObject = new LuposDocument();
            final LuposJTextPane textPaneObject = new LuposJTextPane(documentObject);
            documentObject.init(TurtleParser.createILuposParser(new LuposDocumentReader(documentObject)), false);
            textPaneObject.setText(t.getObject().toString(
                prefixInstance));
            textPaneObject.setEditable(false);

            rows[i++] = new Object[] { textPaneSubject,
                textPanePredicate, textPaneObject };
          } else {
            rows[i++] = new String[] {
                t.getSubject().toString(prefixInstance),
                t.getPredicate().toString(prefixInstance),
                t.getObject().toString(prefixInstance) };
          }
        }

        tablesJTable[indexJTables++] = generateTable(rows, tableHead,
            operatorGraph);
      } else {
        final HashSet<Variable> variables = new HashSet<Variable>();

        // get variables...
        for (final Bindings ba : qr) {
          variables.addAll(ba.getVariableSet());
        }

        // --- generate table head - begin ---
        final String[] tableHead = new String[variables.size()];

        int i = 0;

        // result order is defined...
        if (resultOrder != null && resultOrder.size() > 0) {
          for (final String s : resultOrder) {
            if (variables.contains(new Variable(s))) {
              tableHead[i++] = "?" + s;
            }
          }
        } else {
          // result order is not defined...
          for (final Variable v : variables) {
            tableHead[i++] = v.toString();
          }
        }
        // --- generate table head - end ---

        // --- generate table rows - begin ---
        final Object[][] rows = new Object[qr.size()][];

        i = 0;

        for (final Bindings ba : qr) {
          final Object[] row = new Object[variables.size()];

          int j = 0;

          // result order is defined...
          if (resultOrder != null && resultOrder.size() > 0) {
            for (final String s : resultOrder) {
              if (variables.contains(new Variable(s))) {
                final Literal literal = ba.get(new Variable(s));
                String value = "";

                if (literal != null) {
                  value = literal.toString(prefixInstance);
                }

                if (operatorGraph == null) {
                  final LuposDocument document = new LuposDocument();
                  final LuposJTextPane textPane = new LuposJTextPane(document);
                  document.init(TurtleParser.createILuposParser(new LuposDocumentReader(document)), false);
                  textPane.setText(value);
                  textPane.setEditable(false);

                  row[j++] = textPane;
                } else {
                  row[j++] = value;
                }
              }
            }
          } else { // result order is not defined...
            for (final Variable variable : variables) {
              final Literal literal = ba.get(variable);
              String value = "";

              if (literal != null) {
                value = literal.toString(prefixInstance);
              }

              if (operatorGraph == null) {
                final LuposDocument document = new LuposDocument();
                final LuposJTextPane textPane = new LuposJTextPane(document);
                document.init(TurtleParser.createILuposParser(new LuposDocumentReader(document)), false);
                textPane.setText(value);
                textPane.setEditable(false);

                row[j++] = textPane;
              } else {
                row[j++] = value;
              }
View Full Code Here

        new AdvancedQueryEditor(Demo_Applet.this.tp_queryInput.getText(), Demo_Applet.this.tp_dataInput.getText(), Demo_Applet.this.myself, getIcon(Demo_Applet.this.webdemo));
      }
    });

    final LuposDocument document = new LuposDocument();
    this.tp_queryInput = new LuposJTextPane(document);
    document.init(SPARQLParser.createILuposParser(new LuposDocumentReader(document)), true, 100);
    new JTextPanePreparer(this.tp_queryInput, StrategyManager.LANGUAGE.SPARQL, document);

    this.queryInputSP = new JScrollPane(this.tp_queryInput);
View Full Code Here

        new VisualRifEditor(Demo_Applet.this.tp_rifInput.getText(), Demo_Applet.getIcon(Demo_Applet.this.webdemo));
      }
    });

    final LuposDocument document = new LuposDocument();
    this.tp_rifInput = new LuposJTextPane(document);
    document.init(RIFParser.createILuposParser(new LuposDocumentReader(document)), true, 100);
    new JTextPanePreparer(this.tp_rifInput, StrategyManager.LANGUAGE.RIF, document);

    this.rifInputSP = new JScrollPane(this.tp_rifInput);
View Full Code Here

        Demo_Applet.this.repaint();
      }
    });

    final LuposDocument document_data = new LuposDocument();
    this.tp_dataInput = new LuposJTextPane(document_data);
    document_data.init(TurtleParser.createILuposParser(new LuposDocumentReader(document_data)), true, 100);
    new JTextPanePreparer(this.tp_dataInput, StrategyManager.LANGUAGE.RDF, document_data);

    this.dataInputSP = new JScrollPane(this.tp_dataInput);
View Full Code Here

    final JPanel panel = new JPanel();
    final JFrame frame = this.createSmallFrame(panel, "Enter Query...");

    // create components for query input with syntax highlighting...
    final LuposDocument document = new LuposDocument();
    final JTextPane tp_query = new LuposJTextPane(document);
    document.init(SPARQLParser.createILuposParser(new LuposDocumentReader(document)), false, 100);

    tp_query.addKeyListener(this.getKeyListener(frame));
    tp_query.setFont(new Font("Courier New", Font.PLAIN, 12));
    tp_query.setPreferredSize(new Dimension(794, 200));
    tp_query.setText("PREFIX dc:      <http://purl.org/dc/elements/1.1/>\nPREFIX dcterms: <http://purl.org/dc/terms/>\n\nSELECT DISTINCT ?author ?yr\nWHERE {\n  ?doc1 dc:author ?author.\n  ?doc1 dc:ref ?doc2.\n  ?doc2 dc:ref ?doc3.\n  ?doc3 dc:ref ?doc1.\n  OPTIONAL {\n    ?doc1 dcterms:issued ?yr. FILTER(?yr < 1950)\n  }\n}\nORDER BY ASC(?author)");

    new LinePainter(tp_query, new Color(202, 223, 245));

    final JScrollPane scroll = new JScrollPane(tp_query);

    // create OK button, which starts query evaluation...
    final JButton bt_ok = new JButton("OK");
    bt_ok.addActionListener(new ActionListener() {
      public void actionPerformed(final ActionEvent ae) {
        try {
          visualGraphs.get(0).clearAll();

          // evaluate query and show graph...
          evaluateQuery(tp_query.getText());

          repaint();

          frame.setVisible(false); // hide query input frame
View Full Code Here

        public void actionPerformed(ActionEvent arg0) {
          JPanel panel = new JPanel();
          final JFrame frame = parent.visualEditor.createSmallFrame(panel, "JumpOverOperator conditions");

          LuposDocument document = new LuposDocument();
          final JTextPane tp = new LuposJTextPane(document);
          document.init(JavaScanner.createILuposParser(new LuposDocumentReader(document)), true);

          tp.addKeyListener(parent.visualEditor.getKeyListener(frame));
          tp.setFont(new Font("Courier New", Font.PLAIN, 12));
          tp.setText(operator.getConditions());

          // create OK button, which starts query evaluation...
          JButton bt_ok = new JButton("OK");
          bt_ok.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
              operator.setConditions(tp.getText());
              frame.setVisible(false); // hide query input frame
            }
          });

          JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.CENTER));
View Full Code Here

    // Panel for short description...
    JPanel shortDescrPanel=new JPanel(new BorderLayout());
    shortDescrPanel.add(new JLabel("Short description:"), BorderLayout.NORTH);
   
    LuposDocument document_shortDescription = new LuposDocument();
    this.tp_shortDescription = new LuposJTextPane(document_shortDescription);
    document_shortDescription.init(HTMLScanner.createILuposParser(new LuposDocumentReader(document_shortDescription)), true);

    JScrollPane sp_shortDescription = new JScrollPane(this.tp_shortDescription);
    sp_shortDescription.setPreferredSize(new Dimension(sp_shortDescription.getPreferredSize().width, 75));
   
    shortDescrPanel.add(sp_shortDescription, BorderLayout.CENTER);

    // Panel for long description...
    JPanel longDescrPanel=new JPanel(new BorderLayout());
    longDescrPanel.add(new JLabel("Long description:"), BorderLayout.NORTH);
   
    LuposDocument document_longDescription = new LuposDocument();
    this.tp_longDescription = new LuposJTextPane(document_longDescription);
    document_longDescription.init(HTMLScanner.createILuposParser(new LuposDocumentReader(document_shortDescription)), true);

    JScrollPane sp_longDescription = new JScrollPane(this.tp_longDescription);
    sp_longDescription.setPreferredSize(new Dimension(sp_longDescription.getPreferredSize().width, 150));

    longDescrPanel.add(sp_longDescription, BorderLayout.CENTER);
   
    // Panel See also
    JPanel seeAlsoPanel=new JPanel(new BorderLayout());
    seeAlsoPanel.add(new JLabel("See also:"), BorderLayout.NORTH);
   
    JPanel rulesPanel=new JPanel(new BorderLayout());
    JPanel rulepackagesPanel=new JPanel(new BorderLayout());
       
    rulesPanel.add(new JLabel("Rules:"), BorderLayout.NORTH);
    rulepackagesPanel.add(new JLabel("Rule Packages:"), BorderLayout.NORTH);
   
    this.seeAlsoPanel_rules = new JPanel(new GridLayout(0,3));

    rulesPanel.add(this.seeAlsoPanel_rules, BorderLayout.CENTER);

    this.seeAlsoPanel_rulePackages = new JPanel(new GridLayout(0,1));

    rulepackagesPanel.add(this.seeAlsoPanel_rulePackages, BorderLayout.CENTER);
   
    JSplitPane seeAlsoSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
    seeAlsoSplitPane.setTopComponent(rulesPanel);
    seeAlsoSplitPane.setBottomComponent(rulepackagesPanel);
    seeAlsoSplitPane.setOneTouchExpandable(true);
    seeAlsoSplitPane.setContinuousLayout(true);
    seeAlsoSplitPane.setDividerLocation(0.5);
   
    seeAlsoPanel.add(seeAlsoSplitPane, BorderLayout.CENTER);
   
    // create split panes...
    JSplitPane descrSplitPane=new JSplitPane(JSplitPane.VERTICAL_SPLIT);
    descrSplitPane.setTopComponent(shortDescrPanel);
    descrSplitPane.setBottomComponent(longDescrPanel);
    descrSplitPane.setOneTouchExpandable(true);
   
    JSplitPane mainSplitPane=new JSplitPane(JSplitPane.VERTICAL_SPLIT);
    mainSplitPane.setTopComponent(descrSplitPane);
    mainSplitPane.setOneTouchExpandable(true);
   
    // Panel Visual Representation   
    final JPanel visualRepresentation = new JPanel(new BorderLayout());
    final JPanel filePanel = new JPanel();

    if(this.elementType == TypeEnum.Rule) {
     
      this.jCB_showVisualRepresentation = new JCheckBox("show visual representation", true);
      visualRepresentation.add(this.jCB_showVisualRepresentation, BorderLayout.NORTH);
     
      final JPanel innerVisualRepresPanel = new JPanel(new BorderLayout());
      this.jCB_showVisualRepresentation.addItemListener(new ItemListener() {
        public void itemStateChanged(ItemEvent ie) {
          innerVisualRepresPanel.setVisible(ie.getStateChange() == ItemEvent.SELECTED);
        }
      });
           
      innerVisualRepresPanel.add(new JLabel("Transition text:"), BorderLayout.NORTH);
     
      LuposDocument document_transitionText = new LuposDocument();
      this.tp_transitionText = new LuposJTextPane(document_transitionText);
      document_transitionText.init(HTMLScanner.createILuposParser(new LuposDocumentReader(document_transitionText)), true);

      JScrollPane sp_transitionText = new JScrollPane(this.tp_transitionText);
      sp_transitionText.setPreferredSize(new Dimension(sp_transitionText.getPreferredSize().width, 75));
View Full Code Here

   
    JPanel globalImportCodePanel=new JPanel(new BorderLayout());
    globalImportCodePanel.add(new JLabel("Additional import declarations:"), BorderLayout.NORTH);

    LuposDocument document_globalImportCode = new LuposDocument();
    this.jTP_additionalImportDeclarations = new LuposJTextPane(document_globalImportCode);
    document_globalImportCode.init(JavaScanner.createILuposParser(new LuposDocumentReader(document_globalImportCode)), true);

    JScrollPane jSP_globalImportCode = new JScrollPane(this.jTP_additionalImportDeclarations);

    globalImportCodePanel.add(jSP_globalImportCode, BorderLayout.CENTER);
   
    JPanel globalJavaCodePanel=new JPanel(new BorderLayout());
    globalJavaCodePanel.add(new JLabel("Additional global java code:"), BorderLayout.NORTH);

    LuposDocument document_globalJavaCode = new LuposDocument();
    this.jTP_globalJavaCode = new LuposJTextPane(document_globalJavaCode);
    document_globalJavaCode.init(JavaScanner.createILuposParser(new LuposDocumentReader(document_globalJavaCode)), true);

    JScrollPane jSP_globalJavaCode = new JScrollPane(this.jTP_globalJavaCode);

    globalJavaCodePanel.add(jSP_globalJavaCode, BorderLayout.CENTER);
View Full Code Here

    panels[0].add(this.jRB_useGeneratedCode_checkMethod, BorderLayout.NORTH);

    this.leftPanel_checkMethod.add(new JLabel("Additional code for check method:"), BorderLayout.NORTH);

    LuposDocument document_additionalCheckJavaCode = new LuposDocument();
    this.jTP_additionalCheckJavaCode = new LuposJTextPane(document_additionalCheckJavaCode);
    document_additionalCheckJavaCode.init(JavaScanner.createILuposParser(new LuposDocumentReader(document_additionalCheckJavaCode)), true);

    JScrollPane jSP_additionalCheckJavaCode = new JScrollPane(this.jTP_additionalCheckJavaCode);

    this.leftPanel_checkMethod.add(jSP_additionalCheckJavaCode, BorderLayout.CENTER);

    panels[0].add(this.leftPanel_checkMethod, BorderLayout.CENTER);

    this.leftPanel_replaceMethod = new JPanel(new BorderLayout());

    this.jRB_useGeneratedCode_replaceMethod = new JRadioButton("Use generated code", true);
    this.jRB_useGeneratedCode_replaceMethod.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(final ActionEvent ee) {
        that.enableSidePanel(that.leftPanel_replaceMethod, true);
        that.enableSidePanel(that.rightPanel_replaceMethod, false);
      }
    });

    this.buttonGroup_replaceMethod.add(this.jRB_useGeneratedCode_replaceMethod);

    panels[1]=new JPanel(new BorderLayout());
    panels[1].add(this.jRB_useGeneratedCode_replaceMethod, BorderLayout.NORTH);

    this.leftPanel_replaceMethod.add(new JLabel("Additional code for replace method:"), BorderLayout.NORTH);

    LuposDocument document_additionalReplaceJavaCode = new LuposDocument();
    this.jTP_additionalReplaceJavaCode = new LuposJTextPane(document_additionalReplaceJavaCode);
    document_additionalReplaceJavaCode.init(JavaScanner.createILuposParser(new LuposDocumentReader(document_additionalReplaceJavaCode)), true);

    JScrollPane jSP_additionalReplaceJavaCode = new JScrollPane(this.jTP_additionalReplaceJavaCode);

    this.leftPanel_replaceMethod.add(jSP_additionalReplaceJavaCode, BorderLayout.CENTER);
View Full Code Here

TOP

Related Classes of lupos.gui.anotherSyntaxHighlighting.LuposJTextPane

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.