Permalink
Browse files

Fix conflicts

  • Loading branch information...
2 parents 824cdcb + 27c3645 commit 3d5473665326b87ae66dd5e3afd68f5fa073fad5 @dianaprajescu dianaprajescu committed Jan 5, 2013
@@ -4,7 +4,7 @@
* @author Unknown-Revengers
*/
-import gui.ElementJPanel;
+import gui.GElement;
import java.awt.Rectangle;
import java.io.BufferedWriter;
@@ -44,7 +44,7 @@
private final String type;
- private ElementJPanel panel;
+ private GElement panel;
private LayoutParser lp;
@@ -72,7 +72,7 @@ public void setInput(String input) {
this.input = input;
}
- public void setPanel(ElementJPanel panel) {
+ public void setPanel(GElement panel) {
this.panel = panel;
}
@@ -1,9 +1,10 @@
package element_actions;
+
import java.awt.Color;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
-import javax.swing.JPanel;
+import javax.swing.JScrollPane;
import javax.swing.border.LineBorder;
/**
@@ -16,65 +17,73 @@
/**
* Mouse over. Schimba culoare border in albastru.
*
- * @param e MouseEvent
+ * @param e
+ * MouseEvent
*
* @return void
*/
@Override
public void mouseEntered(MouseEvent e) {
- ((JPanel) e.getSource()).setBorder(new LineBorder(Color.BLUE));
+ ((JScrollPane) e.getSource()).setBorder(new LineBorder(Color.BLUE));
}
/**
* Mouse click. Selecteaza / deselecteaza element. Selectia este tinuta in
* tooltip.
*
- * @param e MouseEvent
+ * @param e
+ * MouseEvent
*
* @return void
*/
@Override
public void mouseClicked(MouseEvent e) {
// Elementul nu este selectat => selecteaza.
- if (((JPanel) e.getSource()).getToolTipText() == null
- || ((JPanel) e.getSource()).getToolTipText().compareTo(
+ if (((JScrollPane) e.getSource()).getToolTipText() == null
+ || ((JScrollPane) e.getSource()).getToolTipText().compareTo(
"selected") != 0) {
- ((JPanel) e.getSource()).setBorder(new LineBorder(Color.YELLOW));
- ((JPanel) e.getSource()).setToolTipText("selected");
+ ((JScrollPane) e.getSource())
+ .setBorder(new LineBorder(Color.YELLOW));
+ ((JScrollPane) e.getSource()).setToolTipText("selected");
}
// Elementul este selectat => deselecteaza.
else {
- ((JPanel) e.getSource()).setBorder(new LineBorder(Color.GREEN));
- ((JPanel) e.getSource()).setToolTipText("");
+ ((JScrollPane) e.getSource())
+ .setBorder(new LineBorder(Color.GREEN));
+ ((JScrollPane) e.getSource()).setToolTipText("");
}
}
/**
* Mouse exit. Schimba culoare border in verde daca nu e selectat si in
* galben daca este selectat.
*
- * @param e MouseEvent
+ * @param e
+ * MouseEvent
*
* @return void
*/
@Override
public void mouseExited(MouseEvent e) {
// Elementul nu este selectat.
- if (((JPanel) e.getSource()).getToolTipText() == null
- || ((JPanel) e.getSource()).getToolTipText().compareTo(
+ if (((JScrollPane) e.getSource()).getToolTipText() == null
+ || ((JScrollPane) e.getSource()).getToolTipText().compareTo(
"selected") != 0) {
- ((JPanel) e.getSource()).setBorder(new LineBorder(Color.GREEN));
+ ((JScrollPane) e.getSource())
+ .setBorder(new LineBorder(Color.GREEN));
}
// Elementul este selectat.
else {
- ((JPanel) e.getSource()).setBorder(new LineBorder(Color.YELLOW));
+ ((JScrollPane) e.getSource())
+ .setBorder(new LineBorder(Color.YELLOW));
}
}
/**
* Mouse pressed.
*
- * @param e MouseEvent
+ * @param e
+ * MouseEvent
*
* @return void
*/
@@ -86,7 +95,8 @@ public void mousePressed(MouseEvent e) {
/**
* Mouse released.
*
- * @param e MouseEvent
+ * @param e
+ * MouseEvent
*
* @return void
*/
@@ -1,6 +1,6 @@
package element_actions;
-import gui.ElementJPanel;
+import gui.GElement;
import parser.LayoutParser;
import analyzer.Analyzer;
import analyzer.AnalyzerSelector;
@@ -22,7 +22,7 @@
* @param lp
* @throws InterruptedException
*/
- public GetText(ElementJPanel panel, LayoutParser lp)
+ public GetText(GElement panel, LayoutParser lp)
throws InterruptedException {
// Select an analyzer.
@@ -1,53 +1,53 @@
-package element_actions;
-
-import gui.ElementJPanel;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-
-import parser.LayoutParser;
-
-/**
- * Button listener pentru salvare modificari.
- *
- * @author Unknown-Revengers
- */
-public class PopupListener implements ActionListener {
-
- private ElementJPanel panel;
-
- private LayoutParser layoutParser;
-
- /**
- * Constructor.
- *
- * @param panel
- */
- public PopupListener(ElementJPanel panel, LayoutParser lp) {
- this.panel = panel;
- this.layoutParser = lp;
- }
-
- @Override
- public void actionPerformed(ActionEvent e) {
- final String action = e.getActionCommand();
-
- Thread actionThread = new Thread() {
- @Override
- public void run() {
- try {
- if (action.compareTo(ElementActions.S_OCR.toString()) == 0) {
- new GetText(panel, layoutParser);
- }
- else if (action.compareTo(ElementActions.S_TEXT.toString()) == 0) {
- new ViewText(panel);
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- };
-
- actionThread.start();
- }
-}
+package element_actions;
+
+import gui.GElement;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import parser.LayoutParser;
+
+/**
+ * Button listener pentru salvare modificari.
+ *
+ * @author Unknown-Revengers
+ */
+public class PopupListener implements ActionListener {
+
+ private GElement panel;
+
+ private LayoutParser layoutParser;
+
+ /**
+ * Constructor.
+ *
+ * @param panel
+ */
+ public PopupListener(GElement panel, LayoutParser lp) {
+ this.panel = panel;
+ this.layoutParser = lp;
+ }
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ final String action = e.getActionCommand();
+
+ Thread actionThread = new Thread() {
+ @Override
+ public void run() {
+ try {
+ if (action.compareTo(ElementActions.S_OCR.toString()) == 0) {
+ new GetText(panel, layoutParser);
+ }
+ else if (action.compareTo(ElementActions.S_TEXT.toString()) == 0) {
+ new ViewText(panel);
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ };
+
+ actionThread.start();
+ }
+}
@@ -1,6 +1,6 @@
package element_actions;
-import gui.ElementJPanel;
+import gui.GElement;
import java.awt.BorderLayout;
import java.awt.Container;
@@ -45,7 +45,7 @@
/**
* Elementul selectat.
*/
- public ElementJPanel elementPanel;
+ public GElement elementPanel;
/**
* TextArea pentru textul elementului.
@@ -58,7 +58,7 @@
* @param panel
* Elementul selectat.
*/
- public ViewText(ElementJPanel panel) {
+ public ViewText(GElement panel) {
this.elementPanel = panel;
// Creaza content panel.
Oops, something went wrong.

0 comments on commit 3d54736

Please sign in to comment.