Author: kono
Date: 2012-12-06 14:49:26 -0800 (Thu, 06 Dec 2012)
New Revision: 30911
Added:
core3/impl/trunk/welcome-impl/src/main/resources/images/Icons/empty.png
core3/impl/trunk/welcome-impl/src/main/resources/images/Icons/logo48.png
core3/impl/trunk/welcome-impl/src/main/resources/images/Icons/open.png
core3/impl/trunk/welcome-impl/src/main/resources/images/Icons/remote.png
Modified:
core3/impl/trunk/datasource-biogrid-impl/src/main/java/org/cytoscape/datasource/biogrid/internal/BiogridDataLoader.java
core3/impl/trunk/welcome-impl/src/main/java/org/cytoscape/welcome/internal/WelcomeScreenDialog.java
core3/impl/trunk/welcome-impl/src/main/java/org/cytoscape/welcome/internal/panel/CreateNewNetworkPanel.java
Log:
Welcome Screen finalized.
Modified:
core3/impl/trunk/datasource-biogrid-impl/src/main/java/org/cytoscape/datasource/biogrid/internal/BiogridDataLoader.java
===================================================================
---
core3/impl/trunk/datasource-biogrid-impl/src/main/java/org/cytoscape/datasource/biogrid/internal/BiogridDataLoader.java
2012-12-06 22:34:26 UTC (rev 30910)
+++
core3/impl/trunk/datasource-biogrid-impl/src/main/java/org/cytoscape/datasource/biogrid/internal/BiogridDataLoader.java
2012-12-06 22:49:26 UTC (rev 30911)
@@ -24,6 +24,7 @@
public class BiogridDataLoader {
private static final String FILE_LOCATION = "biogrid.file.url";
+ private static final String TAG = "<meta>preset,interactome</meta>";
// Default resource file location.
private static final String DEF_RESOURCE =
"biogrid/BIOGRID-ORGANISM-3.2.95.mitab.zip";
@@ -44,6 +45,7 @@
FILTER.put("Drosophila_melanogaster", new String[]{"Fly",
"BioGRID","Fly Interactome from BioGRID database"} );
FILTER.put("Mus_musculus", new String[]{"Mouse", "BioGRID",
"Mouse Interactome from BioGRID database"});
FILTER.put("Arabidopsis_thaliana", new String[]{"Arabidopsis",
"BioGRID", "Arabidopsis from BioGRID database"});
+ FILTER.put("Caenorhabditis_elegans", new String[]{"C. Elegans",
"BioGRID", "Caenorhabditis Elegans from BioGRID database"});
}
public BiogridDataLoader(final CyProperty props, final File
settingFileLocation) {
@@ -74,11 +76,12 @@
version = "Unknown";
else {
String[] nextPart = parts[1].split(".mitab.zip");
- if(nextPart == null || nextPart.length != 2)
+ if(nextPart == null || nextPart.length != 1)
version = "Unknown";
else
version = nextPart[0];
}
+
this.sources = new HashSet<DataSource>();
localFile = new File(settingFileLocation, LOCAL);
@@ -142,7 +145,7 @@
processOneEntry(outFile, zis);
zis.closeEntry();
- final DataSource ds = new
DefaultDataSource(data[0], data[1], data[2] + " Release " + version,
DataCategory.NETWORK, outFile.toURI().toURL());
+ final DataSource ds = new
DefaultDataSource(data[0], data[1], TAG + data[2] + " Release " + version,
DataCategory.NETWORK, outFile.toURI().toURL());
sources.add(ds);
}
@@ -159,7 +162,7 @@
for (File file : dataFiles) {
final String[] data = createName(file.getName());
- final DataSource ds = new DefaultDataSource(data[0],
data[1], data[2], DataCategory.NETWORK, file.toURI()
+ final DataSource ds = new DefaultDataSource(data[0],
data[1], TAG + data[2] + " Release " + version, DataCategory.NETWORK,
file.toURI()
.toURL());
sources.add(ds);
}
Modified:
core3/impl/trunk/welcome-impl/src/main/java/org/cytoscape/welcome/internal/WelcomeScreenDialog.java
===================================================================
---
core3/impl/trunk/welcome-impl/src/main/java/org/cytoscape/welcome/internal/WelcomeScreenDialog.java
2012-12-06 22:34:26 UTC (rev 30910)
+++
core3/impl/trunk/welcome-impl/src/main/java/org/cytoscape/welcome/internal/WelcomeScreenDialog.java
2012-12-06 22:49:26 UTC (rev 30911)
@@ -24,7 +24,6 @@
import org.cytoscape.property.CyProperty;
import org.cytoscape.welcome.internal.panel.CreateNewNetworkPanel;
-import org.cytoscape.welcome.internal.panel.LogoPanel;
import org.cytoscape.welcome.internal.panel.NewsAndLinkPanel;
import org.cytoscape.welcome.internal.panel.OpenPanel;
import org.cytoscape.welcome.internal.panel.WelcomeScreenChildPanel;
@@ -145,32 +144,27 @@
}
private void createChildPanels() {
- JPanel panel1 = new JPanel();
- JPanel panel2 = new JPanel();
- JPanel panel3 = new JPanel();
- JPanel panel4 = new JPanel();
+ JPanel openSessionPanel = new JPanel();
+ JPanel newSessionPanel = new JPanel();
+ JPanel newsPanel = new JPanel();
- panel1.setOpaque(false);
- panel2.setOpaque(false);
- panel3.setOpaque(false);
- panel4.setOpaque(false);
+ openSessionPanel.setOpaque(false);
+ newSessionPanel.setOpaque(false);
+ newsPanel.setOpaque(false);
Color borderPaint = new Color(0xff, 0xff, 0xff, 50);
final LineBorder border = new LineBorder(borderPaint, 5, false);
- panel1.setBorder(border);
- panel2.setBorder(border);
- panel3.setBorder(border);
- panel4.setBorder(border);
+ openSessionPanel.setBorder(border);
+ newSessionPanel.setBorder(border);
+ newsPanel.setBorder(border);
- panel1.setBackground(PANEL_COLOR);
- panel2.setBackground(PANEL_COLOR);
- panel3.setBackground(PANEL_COLOR);
- panel4.setBackground(PANEL_COLOR);
+ openSessionPanel.setBackground(PANEL_COLOR);
+ newSessionPanel.setBackground(PANEL_COLOR);
+ newsPanel.setBackground(PANEL_COLOR);
- setChildPanel(panel1, openPanel, "Open Recent Session");
- setChildPanel(panel2, importPanel, "Start New Session");
- setChildPanel(panel3, helpPanel, "News and Links");
- setLogoPanel(panel4, new LogoPanel());
+ setChildPanel(openSessionPanel, openPanel, "Open Recent
Session");
+ setChildPanel(newSessionPanel, importPanel, "Start New
Session");
+ setChildPanel(newsPanel, helpPanel, "News and Links");
final JPanel leftPanel = new JPanel();
final JPanel rightPanel = new JPanel();
@@ -179,16 +173,17 @@
rightPanel.setOpaque(false);
rightPanel.setLayout(new GridLayout(1, 1));
- final JPanel centerPanel = new JPanel();
- centerPanel.setOpaque(false);
- centerPanel.setLayout(new GridLayout(2, 1));
+ leftPanel.setOpaque(false);
+ leftPanel.setLayout(new GridLayout(1, 1));
+ rightPanel.setOpaque(false);
+ rightPanel.setLayout(new GridLayout(2, 1));
mainPanel.setBorder(border);
- leftPanel.add(panel1);
- leftPanel.add(panel3);
+ rightPanel.add(openSessionPanel);
+ rightPanel.add(newsPanel);
- rightPanel.add(panel2);
+ leftPanel.add(newSessionPanel);
mainPanel.add(leftPanel);
mainPanel.add(rightPanel);
@@ -211,10 +206,4 @@
panel.add(titlePanel, BorderLayout.NORTH);
panel.add(contentPanel, BorderLayout.CENTER);
}
-
- private void setLogoPanel(JPanel panel, JPanel contentPanel) {
- contentPanel.setBackground(LOGO_PANEL_COLOR);
- panel.setLayout(new BorderLayout());
- panel.add(contentPanel, BorderLayout.CENTER);
- }
}
Modified:
core3/impl/trunk/welcome-impl/src/main/java/org/cytoscape/welcome/internal/panel/CreateNewNetworkPanel.java
===================================================================
---
core3/impl/trunk/welcome-impl/src/main/java/org/cytoscape/welcome/internal/panel/CreateNewNetworkPanel.java
2012-12-06 22:34:26 UTC (rev 30910)
+++
core3/impl/trunk/welcome-impl/src/main/java/org/cytoscape/welcome/internal/panel/CreateNewNetworkPanel.java
2012-12-06 22:49:26 UTC (rev 30911)
@@ -1,40 +1,46 @@
package org.cytoscape.welcome.internal.panel;
+import java.awt.BorderLayout;
import java.awt.Color;
-import java.awt.Cursor;
-import java.awt.Dimension;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
+import java.awt.image.BufferedImage;
+import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
+import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
+import java.util.List;
import java.util.Map;
import java.util.SortedSet;
import java.util.TreeSet;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import javax.imageio.ImageIO;
import javax.swing.BorderFactory;
-import javax.swing.BoxLayout;
import javax.swing.ButtonGroup;
import javax.swing.ButtonModel;
-import javax.swing.DefaultComboBoxModel;
-import javax.swing.JComboBox;
-import javax.swing.JLabel;
+import javax.swing.Icon;
+import javax.swing.ImageIcon;
+import javax.swing.JButton;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JScrollPane;
-import javax.swing.border.Border;
+import javax.swing.SwingConstants;
import javax.swing.border.LineBorder;
-import javax.swing.border.TitledBorder;
import org.cytoscape.application.swing.CyAction;
import org.cytoscape.io.DataCategory;
import org.cytoscape.io.datasource.DataSource;
import org.cytoscape.io.datasource.DataSourceManager;
import org.cytoscape.task.read.LoadNetworkURLTaskFactory;
+import org.cytoscape.welcome.internal.WelcomeScreenDialog;
import org.cytoscape.work.AbstractTask;
import org.cytoscape.work.TaskFactory;
import org.cytoscape.work.TaskIterator;
@@ -50,21 +56,69 @@
private static final long serialVersionUID = -8750909701276867389L;
private static final Logger logger =
LoggerFactory.getLogger(CreateNewNetworkPanel.class);
+
+ private static final Icon NEW_ICON;
+ private static final Icon PRESET_ICON;
+ private static final Icon DATABASE_ICON;
+ private static final Icon OPEN_ICON;
+
+ private static final Pattern METATAG =
Pattern.compile("(.*?)<meta>(.+?)</meta>(.*?)");
+ static {
+ BufferedImage newImage = null;
+ BufferedImage databaseImage = null;
+ BufferedImage loadImage = null;
+ BufferedImage presetImage = null;
+
+ try {
+ newImage =
ImageIO.read(WelcomeScreenDialog.class.getClassLoader().getResource("images/Icons/empty.png"));
+ } catch (IOException e) {
+ logger.warn("Could not create Icon.", e);
+ }
+
+ try {
+ databaseImage =
ImageIO.read(WelcomeScreenDialog.class.getClassLoader().getResource(
+ "images/Icons/remote.png"));
+ } catch (IOException e) {
+ logger.warn("Could not create Icon.", e);
+ }
+ try {
+ loadImage =
ImageIO.read(WelcomeScreenDialog.class.getClassLoader().getResource("images/Icons/open.png"));
+ } catch (IOException e) {
+ logger.warn("Could not create Icon.", e);
+ }
+
+ try {
+ presetImage =
ImageIO.read(WelcomeScreenDialog.class.getClassLoader().getResource("images/Icons/logo48.png"));
+ } catch (IOException e) {
+ logger.warn("Could not create Icon.", e);
+ }
+
+ if (newImage != null)
+ NEW_ICON = new ImageIcon(newImage);
+ else
+ NEW_ICON = null;
+
+ if (databaseImage != null)
+ DATABASE_ICON = new ImageIcon(databaseImage);
+ else
+ DATABASE_ICON = null;
+
+ if (loadImage != null)
+ OPEN_ICON = new ImageIcon(loadImage);
+ else
+ OPEN_ICON = null;
+
+ if (presetImage != null)
+ PRESET_ICON = new ImageIcon(presetImage);
+ else
+ PRESET_ICON = null;
+ }
+
public static final String WORKFLOW_ID = "welcomeScreenWorkflowID";
public static final String WORKFLOW_NAME = "welcomeScreenWorkflowName";
public static final String WORKFLOW_DESCRIPTION =
"welcomeScreenWorkflowDescription";
- private JLabel loadNetwork;
- private JLabel fromDB;
- private JLabel fromWebService;
-
- private final ButtonGroup gr = new ButtonGroup();
- private final JPanel optionPanel = new JPanel();
-
- // List of Preset Data
- private JComboBox networkList;
-
private final DialogTaskManager guiTaskManager;
private final BundleContext bc;
private final LoadNetworkURLTaskFactory importNetworkFromURLTF;
@@ -75,6 +129,10 @@
private final Map<ButtonModel, TaskFactory> button2taskMap = new
HashMap<ButtonModel, TaskFactory>();
private JRadioButton noOptionTaskButton;
+ private List<JRadioButton> buttonList;
+ private JPanel sourceButtons;
+ private ButtonGroup bGroup;
+
public CreateNewNetworkPanel(final BundleContext bc, final
DialogTaskManager guiTaskManager,
final TaskFactory importNetworkFileTF, final
LoadNetworkURLTaskFactory loadTF,
final DataSourceManager dsManager) {
@@ -84,28 +142,15 @@
this.importNetworkFileTF = importNetworkFileTF;
this.guiTaskManager = guiTaskManager;
this.dsManager = dsManager;
-
this.dataSourceMap = new HashMap<String, String>();
- this.networkList = new JComboBox();
- networkList.setEnabled(false);
setFromDataSource();
initComponents();
-
- // Enable combo box listener here to avoid unnecessary reaction.
- this.networkList.addActionListener(new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent e) {
- loadPreset();
- }
- });
-
- networkList.setEnabled(true);
}
-
+
private void setFromDataSource() {
- DefaultComboBoxModel theModel = new DefaultComboBoxModel();
-
+ buttonList = new ArrayList<JRadioButton>();
+
// Extract the URL entries
final Collection<DataSource> dataSources =
dsManager.getDataSources(DataCategory.NETWORK);
final SortedSet<String> labelSet = new TreeSet<String>();
@@ -114,151 +159,130 @@
String link = null;
link = ds.getLocation().toString();
final String sourceName = ds.getName();
- final String provider = ds.getProvider();
- final String sourceLabel = provider + ":" +
sourceName;
- dataSourceMap.put(sourceLabel, link);
- labelSet.add(sourceLabel);
+ String description = ds.getDescription();
+ Matcher match = METATAG.matcher(description);
+ boolean found = match.matches();
+ if (!found)
+ continue;
+
+ final String tags = match.group(2);
+
+ final String tooltip = match.group(3);
+ final String[] res = tags.split(",");
+
+ if (res != null) {
+ final List<String> tagList =
Arrays.asList(res);
+ if (tagList.contains("preset")) {
+ final String sourceLabel =
sourceName;
+ dataSourceMap.put(sourceLabel,
link);
+
+ final JRadioButton button = new
JRadioButton(sourceLabel);
+ button.setToolTipText(tooltip);
+ buttonList.add(button);
+ labelSet.add(sourceLabel);
+ }
+ }
}
}
- theModel.addElement("Select a network ...");
-
- for (final String label : labelSet)
- theModel.addElement(label);
-
- this.networkList.setModel(theModel);
+ bGroup = new ButtonGroup();
+ sourceButtons = new JPanel();
+ sourceButtons.setOpaque(false);
+
+ // Determine Size of Grid
+ int rowCount = buttonList.size()/2;
+ int mod = buttonList.size()%2;
+ sourceButtons.setLayout(new GridLayout(rowCount+mod, 2));
+ for(JRadioButton rb: buttonList) {
+ sourceButtons.add(rb);
+ sourceButtons.setOpaque(false);
+ bGroup.add(rb);
+ }
}
private void initComponents() {
- this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
-
+ // Basic layout of this panel (2 rows)
+ this.setLayout(new GridLayout(2,1));
+
// Label border
- final Border labelPadding = BorderFactory.createEmptyBorder(2,
10, 2, 8);
-
this.setBorder(new LineBorder(new Color(0, 0, 0, 0), 10));
- //////////////////
- JLabel lbStartEmpty = new JLabel("Start without data");
- lbStartEmpty.setFont(COMMAND_FONT);
- lbStartEmpty.setForeground(COMMAND_FONT_COLOR);
- lbStartEmpty.setHorizontalAlignment(JLabel.LEFT);
- lbStartEmpty.setHorizontalTextPosition(JLabel.LEFT);
- lbStartEmpty.setCursor(new Cursor(Cursor.HAND_CURSOR));
- lbStartEmpty.addMouseListener(new MouseAdapter() {
+ final JButton createEmptySessionButton = new JButton();
+ createEmptySessionButton.setText("New/Empty Network");
+ createEmptySessionButton.setIcon(NEW_ICON);
+
createEmptySessionButton.setHorizontalAlignment(SwingConstants.LEFT);
+ createEmptySessionButton.setIconTextGap(20);
+ createEmptySessionButton.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent ev) {
- //close parent window only.
closeParentWindow();
}
});
-
- // Start empty session without data
- final JPanel pnlEmptySession = new JPanel();
- pnlEmptySession.setLayout(new GridLayout(1, 1));
-
pnlEmptySession.setBorder(BorderFactory.createTitledBorder("Start Empty
Session"));
- pnlEmptySession.setOpaque(false);
- final Dimension emptyPanelSize = new Dimension(300, 60);
- lbStartEmpty.setMaximumSize(emptyPanelSize);
- lbStartEmpty.setBorder(labelPadding);
- pnlEmptySession.setPreferredSize(emptyPanelSize);
- pnlEmptySession.setSize(emptyPanelSize);
- pnlEmptySession.setMaximumSize(emptyPanelSize);
- pnlEmptySession.add(lbStartEmpty);
-
- //////////////////
- this.loadNetwork = new JLabel("Import network from file...");
- loadNetwork.setFont(COMMAND_FONT);
- loadNetwork.setForeground(COMMAND_FONT_COLOR);
- this.loadNetwork.setCursor(new Cursor(Cursor.HAND_CURSOR));
-
- loadNetwork.addMouseListener(new MouseAdapter() {
+ final JButton importFromFileButton = new JButton();
+ importFromFileButton.setText("From Network File...");
+ importFromFileButton.setIcon(OPEN_ICON);
+
importFromFileButton.setHorizontalAlignment(SwingConstants.LEFT);
+ importFromFileButton.setIconTextGap(20);
+ importFromFileButton.addActionListener(new ActionListener() {
@Override
- public void mouseClicked(MouseEvent ev) {
+ public void actionPerformed(ActionEvent arg0) {
loadFromFile();
}
});
+ JPanel dbButtonPanel = new JPanel();
+ dbButtonPanel.setLayout(new GridLayout(1,1));
+ dbButtonPanel.setOpaque(false);
+ JButton dbButton = new JButton("From Network Database...");
+ dbButton.setIcon(DATABASE_ICON);
+ dbButton.setIconTextGap(20);
+ dbButton.setHorizontalAlignment(SwingConstants.LEFT);
+ dbButton.addActionListener(new ActionListener() {
- this.fromDB = new JLabel("Import network from reference data
set:");
- fromDB.setFont(COMMAND_FONT);
- fromDB.setForeground(COMMAND_FONT_COLOR);
- this.fromWebService = new JLabel("Import Network from Public
Database...");
- fromWebService.setFont(COMMAND_FONT);
- fromWebService.setForeground(COMMAND_FONT_COLOR);
- fromWebService.setHorizontalAlignment(JLabel.LEFT);
- fromWebService.setHorizontalTextPosition(JLabel.LEFT);
- this.fromWebService.setCursor(new Cursor(Cursor.HAND_CURSOR));
- this.fromWebService.addMouseListener(new MouseAdapter() {
@Override
- public void mouseClicked(MouseEvent ev) {
+ public void actionPerformed(ActionEvent e) {
// Load network from web service.
closeParentWindow();
try {
execute(bc);
- } catch (InvalidSyntaxException e) {
+ } catch (InvalidSyntaxException ise) {
logger.error("Could not execute the
action", e);
}
}
+
});
+
+ final JPanel buttonPanel = new JPanel();
+ buttonPanel.setLayout(new GridLayout(3, 1));
+ buttonPanel.add(createEmptySessionButton);
+ buttonPanel.add(importFromFileButton);
+ buttonPanel.add(dbButton);
+ this.add(buttonPanel);
- // Remote access
- final JPanel wsPanel = new JPanel();
- wsPanel.setLayout(new GridLayout(1, 1));
- wsPanel.setBorder(BorderFactory.createTitledBorder("Access
Remote Service"));
- wsPanel.setOpaque(false);
- final Dimension dbPanelSize = new Dimension(300, 60);
- fromWebService.setMaximumSize(dbPanelSize);
- fromWebService.setBorder(labelPadding);
- wsPanel.setPreferredSize(dbPanelSize);
- wsPanel.setSize(dbPanelSize);
- wsPanel.setMaximumSize(dbPanelSize);
- wsPanel.add(fromWebService);
+ final JPanel presetPanel = new JPanel();
+ presetPanel.setBorder(BorderFactory.createTitledBorder("From
Preset Network"));
+ presetPanel.setOpaque(false);
+ presetPanel.setLayout(new BorderLayout());
+ JScrollPane buttonScrollPane = new JScrollPane();
+ buttonScrollPane.setViewportView(sourceButtons);
+ presetPanel.add(buttonScrollPane, BorderLayout.CENTER);
+ final JButton importPresetButton = new JButton("Load Preset
Network");
+ importPresetButton.addActionListener(new ActionListener() {
- final Dimension importPanelSize = new Dimension(300, 120);
- final JPanel importPanel = new JPanel();
- importPanel.setMaximumSize(importPanelSize);
- importPanel.setLayout(new GridLayout(3, 1));
- importPanel.setOpaque(false);
- loadNetwork.setBorder(labelPadding);
- fromDB.setBorder(labelPadding);
- networkList.setFont(REGULAR_FONT);
- networkList.setForeground(REGULAR_FONT_COLOR);
+ @Override
+ public void actionPerformed(ActionEvent arg0) {
+ loadPreset();
+ }
+
+ });
+ presetPanel.add(importPresetButton, BorderLayout.SOUTH);
- importPanel.add(loadNetwork);
- importPanel.add(fromDB);
- importPanel.add(networkList);
-
- final JPanel bottomPanel = new JPanel();
- bottomPanel.setOpaque(false);
- bottomPanel.setLayout(new BoxLayout(bottomPanel,
BoxLayout.Y_AXIS));
- bottomPanel.setBorder(BorderFactory.createTitledBorder("Common
Workflow"));
-
- bottomPanel.add(importPanel);
- bottomPanel.add(initOptionPanel());
- this.add(pnlEmptySession);
- this.add(wsPanel);
- this.add(bottomPanel);
-
+ this.add(presetPanel);
+
createPresetTasks();
}
- private JScrollPane initOptionPanel() {
-
- final JScrollPane optionPane = new JScrollPane();
-
optionPane.setBorder(BorderFactory.createTitledBorder(BorderFactory.createLineBorder(REGULAR_FONT_COLOR,
1),
- "Optional Tasks after Data Import",
TitledBorder.CENTER, TitledBorder.CENTER, REGULAR_FONT,
- REGULAR_FONT_COLOR));
-
- optionPanel.setLayout(new BoxLayout(optionPanel,
BoxLayout.Y_AXIS));
- optionPanel.setOpaque(false);
-
- optionPane.setViewportView(optionPanel);
- optionPane.setOpaque(false);
-
optionPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
- return optionPane;
- }
-
private final void loadFromFile() {
final TaskIterator itr =
importNetworkFileTF.createTaskIterator();
importNetwork(itr);
@@ -266,7 +290,14 @@
private void loadPreset() {
// Get selected file from the combo box
- final Object file = networkList.getSelectedItem();
+ Object file = null;
+ for(JRadioButton button: buttonList) {
+ if(button.isSelected()) {
+ file = button.getText();
+ break;
+ }
+ }
+
if (file == null)
return;
@@ -284,17 +315,6 @@
}
private void importNetwork(final TaskIterator loadTaskIt) {
-
- final ButtonModel selected = gr.getSelection();
- if (selected != null) {
- final TaskFactory factory =
button2taskMap.get(selected);
-
- if (factory != null) {
- final TaskIterator optionalTasks =
factory.createTaskIterator();
- loadTaskIt.append(optionalTasks);
- }
- }
-
loadTaskIt.append(new ResetTask());
closeParentWindow();
guiTaskManager.execute(loadTaskIt);
@@ -330,8 +350,6 @@
final JRadioButton taskButton = new
JRadioButton(workflowName.toString());
taskButton.setFont(REGULAR_FONT);
taskButton.setForeground(REGULAR_FONT_COLOR);
- gr.add(taskButton);
- optionPanel.add(taskButton);
button2taskMap.put(taskButton.getModel(), factory);
if (description != null)
@@ -346,10 +364,6 @@
noOptionTaskButton = new JRadioButton("No Optional Task");
noOptionTaskButton.setFont(REGULAR_FONT);
noOptionTaskButton.setForeground(REGULAR_FONT_COLOR);
- gr.add(noOptionTaskButton);
- optionPanel.add(noOptionTaskButton);
-
- gr.setSelected(noOptionTaskButton.getModel(), true);
}
private final class ResetTask extends AbstractTask {
@@ -357,8 +371,7 @@
@Override
public void run(TaskMonitor taskMonitor) throws Exception {
- gr.setSelected(noOptionTaskButton.getModel(), true);
- networkList.setSelectedIndex(0);
+// networkList.setSelectedIndex(0);
}
}
}
Added: core3/impl/trunk/welcome-impl/src/main/resources/images/Icons/empty.png
===================================================================
(Binary files differ)
Property changes on:
core3/impl/trunk/welcome-impl/src/main/resources/images/Icons/empty.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: core3/impl/trunk/welcome-impl/src/main/resources/images/Icons/logo48.png
===================================================================
(Binary files differ)
Property changes on:
core3/impl/trunk/welcome-impl/src/main/resources/images/Icons/logo48.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: core3/impl/trunk/welcome-impl/src/main/resources/images/Icons/open.png
===================================================================
(Binary files differ)
Property changes on:
core3/impl/trunk/welcome-impl/src/main/resources/images/Icons/open.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: core3/impl/trunk/welcome-impl/src/main/resources/images/Icons/remote.png
===================================================================
(Binary files differ)
Property changes on:
core3/impl/trunk/welcome-impl/src/main/resources/images/Icons/remote.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
--
You received this message because you are subscribed to the Google Groups
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/cytoscape-cvs?hl=en.