Commit ab943dde authored by Romana Pernischova's avatar Romana Pernischova
Browse files

scrolling of change panel, impact panel, impact descriptions

parent 6c2a08d0
......@@ -18,12 +18,10 @@ public class ChangeImpact extends Metric implements ImpactMetric {
public ChangeImpact(ChimpReasoner customReasoner) {
super("Change-based Impact",
"This measure signals the amount of changed axioms (added and removed) in the materialization" +
" with \\Delta_i^+ and \\Delta_i^- " +
" in comparison to the number of changed axioms in the ontology, which are denoted with \\delta_i^+" +
" and \\delta_i^-." +
" The changes to the materialization do not include the changes to the ontology, therefore," +
" \\Delta_i \backslash \\delta_i = {}",
"We divide the number of changed inferred axioms by the number of changed ontology axioms. " +
"This metrics gives an indication of how impactful each change is on the inferrence. " +
"A number close and above 1 signals that the number of changes to the ontology have an " +
"equivalent number of changes on the inferrence.",
"\\gamma = \\frac{|\\Delta_i^+| + |\\Delta_i^-|}{|\\delta_i^+| + |\\delta_i^-|}");
this.customReasoner = customReasoner;
......
......@@ -16,14 +16,11 @@ public class SizeImpact extends Metric implements ImpactMetric {
public SizeImpact(ChimpReasoner customReasoner) {
super("Size-based Impact",
"This measure signals the amount of changed axioms (added and removed) in the materialization," +
" denoted with \\Delta_i^+ and \\Delta_i^-" +
"in comparison to the unchanged part of the materialization." +
"A materialization is denoted with M, therefore the intersection between the two versions " +
"of the materialization with M_{i} \\cap M_{i+1}." +
"This comparison occurs between the first materialization, when the reasoner was started " +
"and the last materialization when the reasoner was synchronized." +
"The materialization does not include the ontology itself.",
"We divide the number of changed inferred axioms by the unchanged inferred axioms. " +
"The unchanged inferred axioms can therefore be seen as the size of the materialization. " +
"This metric does not consider the size or changes on the ontology itself, but only to " +
"the inferrence. The number received can be interpreted as a percentage of how much the " +
"materialization is changing.",
"\\sigma = \\frac{|\\Delta_i^+| + |\\Delta_i^-|}{|M_{i} \\cap M_{i+1}|}");
this.customReasoner = customReasoner;
}
......
......@@ -52,7 +52,7 @@ public class ChimpPlugin extends AbstractOWLViewComponent implements ChimpLayout
JSplitPane innerSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT,
lastChangePanel,
new ChimpScrollPane(lastChangePanel),
new ChimpScrollPane(impactMetricsPanel)
);
innerSplitPane.setDividerLocation(100);
......
......@@ -20,8 +20,8 @@ public class ImpactDisplayPanel extends JPanel implements ChimpLayout {
private Metric chosenMetric;
private final JComboBox<Object> dropdown = new JComboBox<>();
private final JLabel valueLabel = new JLabel();
private final JLabel formulaLabel = new JLabel();
private final JLabel descriptionLabel = new JLabel();
// private final JLabel formulaLabel = new JLabel();
private final JTextArea descriptionLabel = new JTextArea();
public ImpactDisplayPanel() {
setLayout(new MigLayout("wrap 2, fill, insets 0", "[][fill]", "[fill]"));
......@@ -33,19 +33,36 @@ public class ImpactDisplayPanel extends JPanel implements ChimpLayout {
chosenMetric = impactMetrics.get(0);
initDropdown(impactMetrics);
JPanel innerPanel = new JPanel(new MigLayout("wrap, fill, insets 0", "", "15[]15[]15[][grow]"));
innerPanel.add(dropdown, "wmin 210, alignx center");
innerPanel.add(valueLabel, "alignx center");
innerPanel.add(formulaLabel, "alignx center");
innerPanel.setBackground(ChimpLayout.BACKGROUND_COLOR);
add(innerPanel);
descriptionLabel.setBorder(new EmptyBorder(15, 15, 0, 15));
descriptionLabel.setVerticalAlignment(SwingConstants.TOP);
JPanel descriptionPanel = new JPanel(new MigLayout("fill, insets 0", "[fill, 100%]", "[fill]"));
descriptionPanel.add(descriptionLabel, "aligny top");
descriptionPanel.setBackground(ChimpLayout.BACKGROUND_COLOR);
add(descriptionPanel);
// JPanel innerPanel = new JPanel(new MigLayout("wrap, fill, insets 0", "", "15[]15[]15[][grow]"));
// innerPanel.add(dropdown, "wmin 210, alignx center");
// innerPanel.add(valueLabel, "alignx center");
//// innerPanel.add(formulaLabel, "alignx center");
// innerPanel.setBackground(ChimpLayout.BACKGROUND_COLOR);
//
// add(innerPanel);
// descriptionLabel.setBorder(new EmptyBorder(15, 15, 0, 15));
// descriptionLabel.setVerticalAlignment(SwingConstants.TOP);
// JPanel descriptionPanel = new JPanel(new MigLayout("fill, insets 0", "[fill, 100%]", "[fill]"));
// descriptionPanel.add(descriptionLabel, "aligny top");
// descriptionPanel.setBackground(ChimpLayout.BACKGROUND_COLOR);
// add(descriptionPanel);
JPanel panel = new JPanel(new MigLayout());
panel.add(dropdown,"wmin 200, alignx left");
panel.add(valueLabel, "wrap, wmin 100, alignx center");
panel.setBackground(ChimpLayout.BACKGROUND_COLOR);
descriptionLabel.setLineWrap(true);
descriptionLabel.setWrapStyleWord(true);
descriptionLabel.setEditable(false);
descriptionLabel.setBorder(null);
descriptionLabel.setPreferredSize(new Dimension(300,100));
descriptionLabel.setBackground(ChimpLayout.BACKGROUND_COLOR);
panel.add(descriptionLabel,"span, wmin 300");
add(panel);
}
public void initDropdown(List<Metric> impactMetrics) {
......@@ -101,10 +118,10 @@ public class ImpactDisplayPanel extends JPanel implements ChimpLayout {
valueLabel.setText("No changes yet");
}
if (chosenMetric.getLatexFormula() != null) {
formulaLabel.setIcon(getLatexImage(chosenMetric.getLatexFormula()));
}
descriptionLabel.setText("<html>" + chosenMetric.getDescription() + "</html>");
// if (chosenMetric.getLatexFormula() != null) {
// formulaLabel.setIcon(getLatexImage(chosenMetric.getLatexFormula()));
// }
descriptionLabel.setText(chosenMetric.getDescription()); //.setText("<html>" + chosenMetric.getDescription() + "</html>");
}
private TeXIcon getLatexImage(String latexString) {
......
......@@ -36,7 +36,7 @@ public class LastChangePanel extends JPanel implements ChimpLayout {
}
};
private static final String title = "Last Change";
private static final String title = "Changes";
private final JLabel noChangesLabel = new JLabel("No changes yet");
private JTree tree;
......@@ -148,7 +148,25 @@ public class LastChangePanel extends JPanel implements ChimpLayout {
private String getChangeString(OWLOntologyChange change) {
if (change instanceof OWLAxiomChange) {
return "&lt;" + change.getAxiom().toString() + "&gt;";
String s = change.getAxiom().toString();
String iri = modelManager.getActiveOntology().getOntologyID().getOntologyIRI().get().toString();
// String name = s.replaceAll(iri,"");
// log.info(s);
// log.info(name);
String[] axiom = s.split("<");
String name = axiom[0];
for(int i=1; i<axiom.length;i++){
int index = axiom[i].indexOf("#");
String sub;
if(index>0){ sub = axiom[i].substring(index+1);
sub = "&lt;" + sub;}
else { sub = axiom[i]; }
name = name.concat(sub);
if(i != axiom.length-1){
name = name.concat(" ");}
}
return "&lt;" + name + "&gt;";
} else if (change instanceof AnnotationChange) {
return ((AnnotationChange) change).getAnnotation().toString();
} else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment