mirror of https://github.com/rusefi/RomRaider.git
Editor Bug Fixes:
- Fix for category node open issue. Double click on node causes the node to open and then close. - Made editor pane's private. Updated logger to access through get methods.
This commit is contained in:
parent
855332c0bc
commit
b631fd2c12
|
@ -68,10 +68,10 @@ import org.w3c.dom.Document;
|
|||
import org.xml.sax.InputSource;
|
||||
import org.xml.sax.SAXParseException;
|
||||
|
||||
import com.romraider.net.BrowserControl;
|
||||
import com.romraider.Settings;
|
||||
import com.romraider.logger.ecu.EcuLogger;
|
||||
import com.romraider.maps.Rom;
|
||||
import com.romraider.net.BrowserControl;
|
||||
import com.romraider.net.URL;
|
||||
import com.romraider.swing.AbstractFrame;
|
||||
import com.romraider.swing.CustomToolbarLayout;
|
||||
|
@ -95,8 +95,10 @@ public class ECUEditor extends AbstractFrame {
|
|||
|
||||
private final RomTreeRootNode imageRoot = new RomTreeRootNode("Open Images");
|
||||
private final RomTree imageList = new RomTree(imageRoot);
|
||||
public MDIDesktopPane rightPanel = new MDIDesktopPane();
|
||||
public JProgressPane statusPanel = new JProgressPane();
|
||||
private final MDIDesktopPane rightPanel = new MDIDesktopPane();
|
||||
private final JProgressPane statusPanel = new JProgressPane();
|
||||
private final JScrollPane leftScrollPane;
|
||||
private final JScrollPane rightScrollPane;
|
||||
private JSplitPane splitPane = new JSplitPane();
|
||||
private Rom lastSelectedRom = null;
|
||||
private ECUEditorToolBar toolBar;
|
||||
|
@ -121,9 +123,9 @@ public class ECUEditor extends AbstractFrame {
|
|||
setExtendedState(MAXIMIZED_BOTH);
|
||||
}
|
||||
|
||||
JScrollPane rightScrollPane = new JScrollPane(rightPanel,
|
||||
rightScrollPane = new JScrollPane(rightPanel,
|
||||
VERTICAL_SCROLLBAR_AS_NEEDED, HORIZONTAL_SCROLLBAR_AS_NEEDED);
|
||||
JScrollPane leftScrollPane = new JScrollPane(imageList,
|
||||
leftScrollPane = new JScrollPane(imageList,
|
||||
VERTICAL_SCROLLBAR_AS_NEEDED, HORIZONTAL_SCROLLBAR_AS_NEEDED);
|
||||
|
||||
splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, leftScrollPane, rightScrollPane);
|
||||
|
@ -526,6 +528,14 @@ public class ECUEditor extends AbstractFrame {
|
|||
public MDIDesktopPane getRightPanel() {
|
||||
return this.rightPanel;
|
||||
}
|
||||
|
||||
public JScrollPane getLeftScrollPane() {
|
||||
return this.leftScrollPane;
|
||||
}
|
||||
|
||||
public JScrollPane getRightScrollPane() {
|
||||
return this.rightScrollPane;
|
||||
}
|
||||
}
|
||||
|
||||
class LaunchLoggerWorker extends SwingWorker<Void, Void> {
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
|
||||
package com.romraider.logger.ecu;
|
||||
|
||||
import com.romraider.net.BrowserControl;
|
||||
import static com.romraider.Version.LOGGER_DEFS_URL;
|
||||
import static com.romraider.Version.PRODUCT_NAME;
|
||||
import static com.romraider.Version.VERSION;
|
||||
|
@ -178,6 +177,7 @@ import com.romraider.logger.external.core.ExternalDataItem;
|
|||
import com.romraider.logger.external.core.ExternalDataSource;
|
||||
import com.romraider.logger.external.core.ExternalDataSourceLoader;
|
||||
import com.romraider.logger.external.core.ExternalDataSourceLoaderImpl;
|
||||
import com.romraider.net.BrowserControl;
|
||||
import com.romraider.swing.AbstractFrame;
|
||||
import com.romraider.swing.SetFont;
|
||||
import com.romraider.util.FormatFilename;
|
||||
|
@ -339,20 +339,20 @@ public final class EcuLogger extends AbstractFrame implements MessageListener {
|
|||
}
|
||||
else {
|
||||
bootstrap();
|
||||
ecuEditor.statusPanel.update("Loading ECU Defs...", 20);
|
||||
ecuEditor.getStatusPanel().update("Loading ECU Defs...", 20);
|
||||
loadEcuDefs();
|
||||
ecuEditor.statusPanel.update("Loading Plugins...", 40);
|
||||
ecuEditor.getStatusPanel().update("Loading Plugins...", 40);
|
||||
loadLoggerPlugins();
|
||||
ecuEditor.statusPanel.update("Loading ECU Parameters...", 60);
|
||||
ecuEditor.getStatusPanel().update("Loading ECU Parameters...", 60);
|
||||
loadLoggerParams();
|
||||
ecuEditor.statusPanel.update("Starting Logger...", 80);
|
||||
ecuEditor.getStatusPanel().update("Starting Logger...", 80);
|
||||
initControllerListeners();
|
||||
initUserInterface();
|
||||
ecuEditor.statusPanel.update("Complete...", 100);
|
||||
ecuEditor.getStatusPanel().update("Complete...", 100);
|
||||
initDataUpdateHandlers();
|
||||
startPortRefresherThread();
|
||||
if (!isLogging()) startLogging();
|
||||
ecuEditor.statusPanel.update("Ready...",0);
|
||||
ecuEditor.getStatusPanel().update("Ready...",0);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -47,6 +47,7 @@ public class RomTree extends JTree implements MouseListener {
|
|||
addMouseListener(this);
|
||||
setCellRenderer(new RomCellRenderer());
|
||||
setFont(new Font("Tahoma", Font.PLAIN, 11));
|
||||
setToggleClickCount(SettingsManager.getSettings().getTableClickCount());
|
||||
|
||||
// key binding actions
|
||||
Action tableSelectAction = new AbstractAction() {
|
||||
|
@ -55,8 +56,15 @@ public class RomTree extends JTree implements MouseListener {
|
|||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
try{
|
||||
Object selectedRow = getSelectionPath().getLastPathComponent();
|
||||
Object selectedRow = getLastSelectedPathComponent();
|
||||
/* if nothing is selected */
|
||||
if (selectedRow == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(selectedRow instanceof TableTreeNode) {
|
||||
showTable(selectedRow);
|
||||
}
|
||||
setLastSelectedRom(selectedRow);
|
||||
}catch(NullPointerException ex) {
|
||||
}
|
||||
|
@ -76,22 +84,16 @@ public class RomTree extends JTree implements MouseListener {
|
|||
@Override
|
||||
public void mouseClicked(MouseEvent e) {
|
||||
try{
|
||||
Object selectedRow = getPathForLocation(e.getX(), e.getY()).getLastPathComponent();
|
||||
Object selectedRow = getLastSelectedPathComponent();
|
||||
/* if nothing is selected */
|
||||
if (selectedRow == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(selectedRow instanceof TableTreeNode) {
|
||||
if (e.getClickCount() >= SettingsManager.getSettings().getTableClickCount()) {
|
||||
if(e.getClickCount() >= SettingsManager.getSettings().getTableClickCount()
|
||||
&& selectedRow instanceof TableTreeNode) {
|
||||
showTable(selectedRow);
|
||||
}
|
||||
} else if(selectedRow instanceof Rom || selectedRow instanceof CategoryTreeNode) {
|
||||
if (e.getClickCount() >= SettingsManager.getSettings().getTableClickCount()) {
|
||||
if(isCollapsed(getRowForLocation(e.getX(),e.getY()))) {
|
||||
expandRow(getRowForLocation(e.getX(),e.getY()));
|
||||
}
|
||||
else {
|
||||
collapseRow(getRowForLocation(e.getX(),e.getY()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
setLastSelectedRom(selectedRow);
|
||||
}catch(NullPointerException ex) {
|
||||
|
@ -111,18 +113,32 @@ public class RomTree extends JTree implements MouseListener {
|
|||
}
|
||||
|
||||
private void setLastSelectedRom(Object selectedNode) {
|
||||
if (selectedNode instanceof TableTreeNode || selectedNode instanceof CategoryTreeNode || selectedNode instanceof Rom) {
|
||||
Object lastSelectedPathComponent = getLastSelectedPathComponent();
|
||||
if(lastSelectedPathComponent instanceof Rom) {
|
||||
Rom node = (Rom) lastSelectedPathComponent;
|
||||
if(null != node) {
|
||||
getEditor().setLastSelectedRom(node);
|
||||
}
|
||||
if (selectedNode == null || selectedNode instanceof RomTreeRootNode) {
|
||||
return;
|
||||
}
|
||||
|
||||
Rom romNode = getRomNode(selectedNode);
|
||||
if(romNode == null) {
|
||||
return;
|
||||
}
|
||||
getEditor().setLastSelectedRom(romNode);
|
||||
getEditor().refreshUI();
|
||||
}
|
||||
|
||||
private Rom getRomNode(Object currentNode){
|
||||
if(currentNode == null) {
|
||||
return null;
|
||||
} else if(currentNode instanceof Rom) {
|
||||
return (Rom)currentNode;
|
||||
} else if(currentNode instanceof TableTreeNode) {
|
||||
return getRomNode(((TableTreeNode)currentNode).getParent());
|
||||
} else if(currentNode instanceof CategoryTreeNode) {
|
||||
return getRomNode(((CategoryTreeNode)currentNode).getParent());
|
||||
}else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mousePressed(MouseEvent e) {
|
||||
}
|
||||
|
|
|
@ -989,6 +989,8 @@ public class SettingsForm extends JFrame implements MouseListener {
|
|||
getSettings().setTableClickCount(2);
|
||||
}
|
||||
|
||||
getEditor().getImageList().setToggleClickCount(getSettings().getTableClickCount());
|
||||
|
||||
if(1 == tableClickBehavior.getSelectedIndex()) { // open/close frame
|
||||
getSettings().setTableClickBehavior(1);
|
||||
} else { // open/focus frame
|
||||
|
|
Loading…
Reference in New Issue