From: <lor...@us...> - 2009-09-23 09:35:23
|
Revision: 1856 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1856&view=rev Author: lorenz_b Date: 2009-09-23 09:35:11 +0000 (Wed, 23 Sep 2009) Log Message: ----------- some gui fixes fixed bug Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/tools/ore/OREApplication.java trunk/src/dl-learner/org/dllearner/tools/ore/TaskManager.java trunk/src/dl-learner/org/dllearner/tools/ore/ui/ExplanationTable.java trunk/src/dl-learner/org/dllearner/tools/ore/ui/ExtractFromSparqlDialog.java trunk/src/dl-learner/org/dllearner/tools/ore/ui/RepairDialog.java trunk/src/dl-learner/org/dllearner/tools/ore/ui/RepairTable.java trunk/src/dl-learner/org/dllearner/tools/ore/ui/wizard/Wizard.java trunk/src/dl-learner/org/dllearner/tools/ore/ui/wizard/descriptors/LearningPanelDescriptor.java trunk/src/dl-learner/org/dllearner/tools/ore/ui/wizard/descriptors/UnsatisfiableExplanationPanelDescriptor.java trunk/src/dl-learner/org/dllearner/tools/ore/ui/wizard/panels/IntroductionPanel.java trunk/src/dl-learner/org/dllearner/tools/ore/ui/wizard/panels/UnsatisfiableExplanationPanel.java Modified: trunk/src/dl-learner/org/dllearner/tools/ore/OREApplication.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/OREApplication.java 2009-09-23 08:49:32 UTC (rev 1855) +++ trunk/src/dl-learner/org/dllearner/tools/ore/OREApplication.java 2009-09-23 09:35:11 UTC (rev 1856) @@ -57,7 +57,6 @@ try { PropertyConfigurator.configure(new URL("file:src/dl-learner/org/dllearner/tools/ore/log4j.properties")); } catch (MalformedURLException e1) { - // TODO Auto-generated catch block e1.printStackTrace(); } @@ -122,11 +121,7 @@ @Override public void run() { - System.out.println("Starting application..."); wizard.showModalDialog(); - System.out.println("Exited ORE application"); - System.exit(0); - } }); Modified: trunk/src/dl-learner/org/dllearner/tools/ore/TaskManager.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/TaskManager.java 2009-09-23 08:49:32 UTC (rev 1855) +++ trunk/src/dl-learner/org/dllearner/tools/ore/TaskManager.java 2009-09-23 09:35:11 UTC (rev 1856) @@ -2,7 +2,7 @@ import java.awt.Cursor; -import javax.swing.JDialog; +import javax.swing.JFrame; import javax.swing.SwingWorker; import org.dllearner.tools.ore.ui.StatusBar; @@ -15,9 +15,8 @@ private StatusBar statusBar; + private JFrame dialog; - private JDialog dialog; - public static synchronized TaskManager getInstance(){ if(instance == null){ instance = new TaskManager(); @@ -33,11 +32,11 @@ return statusBar; } - public void setDialog(JDialog dialog){ + public void setDialog(JFrame dialog){ this.dialog = dialog; } - public JDialog getDialog(){ + public JFrame getDialog(){ return dialog; } Modified: trunk/src/dl-learner/org/dllearner/tools/ore/ui/ExplanationTable.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/ui/ExplanationTable.java 2009-09-23 08:49:32 UTC (rev 1855) +++ trunk/src/dl-learner/org/dllearner/tools/ore/ui/ExplanationTable.java 2009-09-23 09:35:11 UTC (rev 1856) @@ -62,7 +62,7 @@ column6.setCellRenderer(new ButtonCellRenderer()); column6.setCellEditor(new ButtonCellEditor()); column6.setResizable(false); - setRowHeight(getRowHeight() + 4); +// setRowHeight(getRowHeight() + 4); setRowHeightEnabled(true); getColumn(0).setCellRenderer(new MultiLineTableCellRenderer()); getColumn(1).setMaxWidth(60); Modified: trunk/src/dl-learner/org/dllearner/tools/ore/ui/ExtractFromSparqlDialog.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/ui/ExtractFromSparqlDialog.java 2009-09-23 08:49:32 UTC (rev 1855) +++ trunk/src/dl-learner/org/dllearner/tools/ore/ui/ExtractFromSparqlDialog.java 2009-09-23 09:35:11 UTC (rev 1856) @@ -2,7 +2,6 @@ import java.awt.BorderLayout; import java.awt.Cursor; -import java.awt.Dialog; import java.awt.Dimension; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; @@ -32,6 +31,7 @@ import javax.swing.JButton; import javax.swing.JComboBox; import javax.swing.JDialog; +import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JRadioButton; @@ -93,7 +93,7 @@ private Map<URL, List<String>> endpointToDefaultGraph; - public ExtractFromSparqlDialog(Dialog owner) { + public ExtractFromSparqlDialog(JFrame owner) { super(owner, "Extract fragment from SPARQL endpoint", true); // Create the controls @@ -238,7 +238,7 @@ } } - private void positionErrorDialog(Dialog owner) { + private void positionErrorDialog(JFrame owner) { if (owner == null || !owner.isVisible()) { Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize(); setLocation(screenDimension.width / 2 - getSize().width / 2, screenDimension.height / 2 - getSize().height / 2); Modified: trunk/src/dl-learner/org/dllearner/tools/ore/ui/RepairDialog.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/ui/RepairDialog.java 2009-09-23 08:49:32 UTC (rev 1855) +++ trunk/src/dl-learner/org/dllearner/tools/ore/ui/RepairDialog.java 2009-09-23 09:35:11 UTC (rev 1856) @@ -36,6 +36,7 @@ import javax.swing.BoxLayout; import javax.swing.JButton; import javax.swing.JDialog; +import javax.swing.JFrame; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JScrollPane; @@ -95,7 +96,7 @@ private Individual ind; - public RepairDialog(Individual ind, JDialog dialog, String mode){ + public RepairDialog(Individual ind, JFrame dialog, String mode){ super(dialog, true); final Component dialogd = this.getParent(); setDefaultCloseOperation(DO_NOTHING_ON_CLOSE); Modified: trunk/src/dl-learner/org/dllearner/tools/ore/ui/RepairTable.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/ui/RepairTable.java 2009-09-23 08:49:32 UTC (rev 1855) +++ trunk/src/dl-learner/org/dllearner/tools/ore/ui/RepairTable.java 2009-09-23 09:35:11 UTC (rev 1856) @@ -104,6 +104,23 @@ }); } + + @Override + public String getToolTipText(MouseEvent event) { + int rowIndex = rowAtPoint(event.getPoint()); + int columnIndex = columnAtPoint(event.getPoint()); + if(columnIndex == 0){ + if(getValueAt(rowIndex, 0).equals("–")){ + return "Remove from ontology"; + } else { + return "Add to ontology"; + } + } else if(columnIndex == 2){ + return "Remove from repair plan"; + } else { + return super.getToolTipText(event); + } + } private void handleKeyPressed(KeyEvent e) { int selRow = getSelectedRow(); Modified: trunk/src/dl-learner/org/dllearner/tools/ore/ui/wizard/Wizard.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/ui/wizard/Wizard.java 2009-09-23 08:49:32 UTC (rev 1855) +++ trunk/src/dl-learner/org/dllearner/tools/ore/ui/wizard/Wizard.java 2009-09-23 09:35:11 UTC (rev 1856) @@ -34,15 +34,13 @@ import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; -import javax.swing.BorderFactory; import javax.swing.Box; import javax.swing.BoxLayout; import javax.swing.JButton; -import javax.swing.JDialog; +import javax.swing.JFrame; import javax.swing.JPanel; -import javax.swing.JScrollPane; import javax.swing.JSeparator; -import javax.swing.JTextArea; +import javax.swing.JTextPane; import javax.swing.UIManager; import javax.swing.border.EmptyBorder; @@ -100,7 +98,7 @@ private WizardModel wizardModel; private WizardController wizardController; - private JDialog wizardDialog; + private JFrame wizardDialog; private JPanel cardPanel; private CardLayout cardLayout; @@ -108,7 +106,7 @@ private JButton backButton; private JButton nextButton; private JButton cancelButton; - private JTextArea informationsField; + private JTextPane informationsField; private StatusBar statusBar; private int returnCode; @@ -129,7 +127,7 @@ */ public Wizard(Dialog owner) { wizardModel = new WizardModel(); - wizardDialog = new JDialog(owner); + wizardDialog = new JFrame(); initComponents(); } @@ -140,7 +138,14 @@ */ public Wizard(Frame owner) { wizardModel = new WizardModel(); - wizardDialog = new JDialog(owner); + wizardDialog = new JFrame(); + wizardDialog.addWindowListener(new WindowAdapter() { + public void windowClosing(WindowEvent e) { + System.out.println("Exited application"); + wizardDialog.dispose(); + } + }); + initComponents(); } @@ -151,7 +156,7 @@ * the event that you want to change any of the JDialog parameters manually. * @return The JDialog instance that this class created. */ - public JDialog getDialog() { + public JFrame getDialog() { return wizardDialog; } @@ -185,15 +190,15 @@ * @param b the modality of the dialog */ public void setModal(boolean b) { - wizardDialog.setModal(b); +// wizardDialog.setModal(b); } /** * Returns the modality of the dialog. * @return A boolean indicating whether or not the generated javax.swing.JDialog is modal. */ - public boolean isModal() { - return wizardDialog.isModal(); + public boolean isModal() {return false; +// return wizardDialog.isModal(); } /** @@ -203,12 +208,9 @@ * constants at the beginning of the class. */ public int showModalDialog() { - - wizardDialog.setModal(true); - //wizardDialog.pack(); + System.out.println("Starting application"); wizardDialog.setVisible(true); - return returnCode; } @@ -367,6 +369,7 @@ */ public void close(int code) { returnCode = code; + System.out.println("Exited application"); wizardDialog.dispose(); } @@ -428,36 +431,23 @@ buttonBox.add(cancelButton); buttonPanel.add(buttonBox, java.awt.BorderLayout.EAST); - buttonPanel.add(statusBar, BorderLayout.SOUTH); - JPanel informationPanel = new JPanel(); - informationPanel.setLayout(new BorderLayout()); - JScrollPane infoScrollPane = new JScrollPane(); - informationsField = new JTextArea(); - - - //setLayout(new GridBagLayout()); - infoScrollPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); - infoScrollPane.setViewportBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); + buttonPanel.add(statusBar, BorderLayout.SOUTH); + Color color = UIManager.getColor("Panel.background"); + informationsField = new JTextPane(); informationsField.setBackground(new Color(color.getRed(), color.getGreen(), color.getBlue())); informationsField.setOpaque(true); - informationsField.setColumns(80); informationsField.setEditable(false); - informationsField.setLineWrap(true); - informationsField.setRows(3); informationsField.setFont(new Font("Serif", Font.PLAIN, 14)); - informationsField.setWrapStyleWord(true); - infoScrollPane.setViewportView(informationsField); - informationPanel.add(infoScrollPane, BorderLayout.EAST); + + wizardDialog.getContentPane().add(buttonPanel, java.awt.BorderLayout.SOUTH); - JPanel buttonInformationPanel = new JPanel(); - buttonInformationPanel.setLayout(new BorderLayout()); - buttonInformationPanel.add(buttonPanel, BorderLayout.SOUTH); - buttonInformationPanel.add(informationPanel, BorderLayout.NORTH); + JPanel infoMainHolder = new JPanel(); + infoMainHolder.setLayout(new BorderLayout()); + infoMainHolder.add(informationsField, BorderLayout.SOUTH); + infoMainHolder.add(cardPanel, BorderLayout.CENTER); + wizardDialog.getContentPane().add(infoMainHolder, java.awt.BorderLayout.CENTER); - wizardDialog.getContentPane().add(buttonInformationPanel, java.awt.BorderLayout.SOUTH); - wizardDialog.getContentPane().add(cardPanel, java.awt.BorderLayout.CENTER); - leftPanel = new LeftPanel(0); wizardDialog.getContentPane().add(leftPanel, BorderLayout.WEST); @@ -492,16 +482,14 @@ * @param i the number of the panel */ public void setLeftPanel(int i) { - ((LeftPanel) (wizardDialog.getContentPane().getComponent(2))).set(i); - - + ((LeftPanel) (wizardDialog.getContentPane().getComponent(2))).set(i); } /** * Returns the information field. - * @return JTextArea + * @return JTextPane */ - public JTextArea getInformationField(){ + public JTextPane getInformationField(){ return informationsField; } @@ -514,8 +502,4 @@ statusBar.setProgressMessage("test"); } - - - - } Modified: trunk/src/dl-learner/org/dllearner/tools/ore/ui/wizard/descriptors/LearningPanelDescriptor.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/ui/wizard/descriptors/LearningPanelDescriptor.java 2009-09-23 08:49:32 UTC (rev 1855) +++ trunk/src/dl-learner/org/dllearner/tools/ore/ui/wizard/descriptors/LearningPanelDescriptor.java 2009-09-23 09:35:11 UTC (rev 1856) @@ -103,7 +103,8 @@ // range); // Description de = new NamedClass("http://example.com/father#male"); - if (!e.getValueIsAdjusting() && (learningTask.isDone() || learningTask.isCancelled())){ + if (!e.getValueIsAdjusting() && learnPanel.getResultTable().getSelectedRow() >= 0 && + (learningTask.isDone() || learningTask.isCancelled())){ EvaluatedDescriptionClass selectedClassExpression = learnPanel.getResultTable().getSelectedValue(); // if(!selectedClassExpression.isConsistent()){ // learnPanel.add(new JLabel("Selected class expression may lead to an inconsistent knowledgebase.")); Modified: trunk/src/dl-learner/org/dllearner/tools/ore/ui/wizard/descriptors/UnsatisfiableExplanationPanelDescriptor.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/ui/wizard/descriptors/UnsatisfiableExplanationPanelDescriptor.java 2009-09-23 08:49:32 UTC (rev 1855) +++ trunk/src/dl-learner/org/dllearner/tools/ore/ui/wizard/descriptors/UnsatisfiableExplanationPanelDescriptor.java 2009-09-23 09:35:11 UTC (rev 1856) @@ -102,8 +102,10 @@ public void actionPerformed(ActionEvent e) { if (e.getActionCommand().equals("regular")) { expMan.setLaconicMode(false); + panel.setStrikeEnabled(true); } else if (e.getActionCommand().equals("laconic")) { expMan.setLaconicMode(true); + panel.setStrikeEnabled(false); } else if (e.getActionCommand().equals("all")){ conditionalWarning("Computing all explanations might take a long time!", getWizard().getDialog()); expMan.setComputeAllExplanationsMode(true); @@ -208,7 +210,7 @@ @Override public Void doInBackground() { statusBar.showProgress(true); - statusBar.setProgressTitle("Computing explanations"); + statusBar.setProgressTitle("Computing explanations..."); getWizard().getDialog().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); for(OWLClass unsat : panel.getUnsatTable().getSelectedClasses()){ expMan.getUnsatisfiableExplanations(unsat); @@ -264,7 +266,7 @@ public Void doInBackground() { statusBar.showProgress(true); - statusBar.setProgressTitle("Computing root derived class"); + statusBar.setProgressTitle("Computing root and derived classes..."); getWizard().getDialog().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); expMan.getRootUnsatisfiableClasses(); expMan.getDerivedClasses(); Modified: trunk/src/dl-learner/org/dllearner/tools/ore/ui/wizard/panels/IntroductionPanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/ui/wizard/panels/IntroductionPanel.java 2009-09-23 08:49:32 UTC (rev 1855) +++ trunk/src/dl-learner/org/dllearner/tools/ore/ui/wizard/panels/IntroductionPanel.java 2009-09-23 09:35:11 UTC (rev 1856) @@ -29,8 +29,7 @@ import javax.swing.BorderFactory; import javax.swing.JLabel; import javax.swing.JPanel; -import javax.swing.JScrollPane; -import javax.swing.JTextArea; +import javax.swing.JTextPane; import javax.swing.UIManager; /** @@ -43,57 +42,54 @@ private static final long serialVersionUID = 7184544803724152044L; - private JTextArea instructionsField; - private JScrollPane jScrollPane1; + private JTextPane instructionsField; private JLabel welcomeTitle; - private final String introductionText = "This is a tool for debugging end enriching OWL-ontologies. " - + "You are able to check ontologies for inconsistency and unsatisfiable classes. " - + "If some of that is detected, helpful explanations can be generated to find out the relevant axioms. " - + "Another feature is to get equivalent class expressions for atomic classes, using an intelligent and efficient " - + "machine learning algorithm. TODO...Jens "; + private final String titleText = "<html>Welcome to the DL-Learner ORE (Ontology Repair and Enrichment) Tool!<br>(Version 0.1)</html>"; - + private final String introductionText = "<html>ORE is a tool for debugging and enriching OWL ontologies. It has the following features: " + + "<UL>" + + "<LI>detection of inconsistencies" + + "<LI>displaying explanations for those inconsistencies" + + "<LI>intelligent resolution of inconsistencies" + + "<LI>enrichment of an ontology by learning definitions and super class axioms" + + "<LI>guiding the user through potential consequences of adding those axioms" + + "</UL>" + + "In a later version, the tool will also support the detection of various potential modelling problems." + + "ORE uses a wizard-style concept. On the left, you can see different steps in the wizard, where the current step is in bold. " + + "Each step contains an explanation of it in the main window. The wizard may omit steps if they are not necessary, e.g. " + + "if you load a consistent ontology, then the \"Debugging\" dialogue is skipped." + + "Please read the <a href=\"http://dl-learner.org/wiki/ORE\">the ORE wiki page</a> and view the <a href=\"...\">screencast</a> to get started.</html>"; - public IntroductionPanel() { createUI(); } private void createUI(){ + setBorder(BorderFactory.createEmptyBorder(12, 6, 12, 12)); setLayout(new GridBagLayout()); GridBagConstraints c = new GridBagConstraints(); c.gridwidth = GridBagConstraints.REMAINDER; c.fill = GridBagConstraints.HORIZONTAL; c.weightx = 1.0; c.anchor = GridBagConstraints.NORTH; - - //setLayout(new GridBagLayout()); - setBorder(BorderFactory.createEmptyBorder(12, 6, 12, 12)); - + welcomeTitle = new JLabel(); welcomeTitle.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, new Color(0, 0, 0))); welcomeTitle.setFont(new java.awt.Font("MS Sans Serif", Font.BOLD, 14)); - welcomeTitle.setText("Welcome to the DL-Learner ORE-Tool!"); + welcomeTitle.setText(titleText); add(welcomeTitle, c); - jScrollPane1 = new JScrollPane(); - jScrollPane1.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); - jScrollPane1.setViewportBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); - instructionsField = new JTextArea(); + instructionsField = new JTextPane(); + instructionsField.setContentType("text/html"); Color color = UIManager.getColor("Panel.background"); instructionsField.setBackground(new Color(color.getRed(), color.getGreen(), color.getBlue())); instructionsField.setOpaque(true); - instructionsField.setColumns(20); instructionsField.setEditable(false); - instructionsField.setLineWrap(true); - instructionsField.setRows(5); instructionsField.setFont(new Font("Serif", Font.PLAIN, 14)); instructionsField.setText(introductionText); - instructionsField.setWrapStyleWord(true); - jScrollPane1.setViewportView(instructionsField); - add(jScrollPane1, c); + add(instructionsField, c); c.weighty = 1.0; add(new JLabel(), c); Modified: trunk/src/dl-learner/org/dllearner/tools/ore/ui/wizard/panels/UnsatisfiableExplanationPanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/ui/wizard/panels/UnsatisfiableExplanationPanel.java 2009-09-23 08:49:32 UTC (rev 1855) +++ trunk/src/dl-learner/org/dllearner/tools/ore/ui/wizard/panels/UnsatisfiableExplanationPanel.java 2009-09-23 09:35:11 UTC (rev 1856) @@ -228,6 +228,7 @@ } public void addExplanations(Set<Explanation> explanations, OWLClass unsat){ + explanationTables.clear(); Box explanationHolderPanel = new Box(1); explanationHolderPanel.setBorder(new TitledBorder(unsat + " is unsatisfiable")); @@ -259,6 +260,10 @@ table.strikeOut(strikeOut); } } + + public void setStrikeEnabled(boolean enabled){ + strikeOutBox.setEnabled(enabled); + } public void addActionListeners(ActionListener aL) { regularButton.addActionListener(aL); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |