Changeset 912
- Timestamp:
- 10/18/06 00:40:54 (2 years ago)
- Files:
-
- trunk/source/org/kolaka/freecast/setup/Main.java (modified) (3 diffs)
- trunk/source/org/kolaka/freecast/setup/ReceiverConfigurationWizardStep.java (moved) (moved from trunk/source/org/kolaka/freecast/setup/ReceiverWizardStep.java) (2 diffs)
- trunk/source/org/kolaka/freecast/setup/ReceiverPlaylistStep.java (modified) (1 diff)
- trunk/source/org/kolaka/freecast/setup/ReceiverShoutClientStep.java (modified) (1 diff)
- trunk/source/org/kolaka/freecast/setup/ReceiverShoutServerStep.java (modified) (1 diff)
- trunk/source/org/kolaka/freecast/setup/ReceiverShowStep.java (modified) (2 diffs)
- trunk/source/org/kolaka/freecast/setup/ReceiverTypeStep.java (modified) (4 diffs)
- trunk/source/org/kolaka/freecast/setup/ReceiverWizardModel.java (modified) (2 diffs)
- trunk/source/org/kolaka/freecast/setup/SetupAction.java (modified) (1 diff)
- trunk/source/org/kolaka/freecast/setup/resources/ReceiverShowStep.properties (added)
- trunk/source/org/kolaka/freecast/swing/ResourcesException.java (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/source/org/kolaka/freecast/setup/Main.java
r909 r912 45 45 private SourceReceiverConfiguration receiverConfiguration; 46 46 private final ReceiverConfigurationLoader receiverConfigurationLoader = new ReceiverConfigurationLoader(); 47 private Resources resources; 47 48 48 49 public Main() { … … 54 55 receiverConfiguration = loadReceiverConfiguration(configuration); 55 56 56 Resourcesresources = new ConfigurableResources(Configurations.subset(configuration, "gui.setup"));57 resources = new ConfigurableResources(Configurations.subset(configuration, "gui.setup")); 57 58 } 58 59 … … 75 76 76 77 protected void run() throws Exception { 77 final ReceiverWizardModel model = new ReceiverWizardModel( );78 final ReceiverWizardModel model = new ReceiverWizardModel(resources); 78 79 model.setReceiverConfiguration(receiverConfiguration); 79 80 trunk/source/org/kolaka/freecast/setup/ReceiverConfigurationWizardStep.java
r883 r912 25 25 26 26 import java.awt.GridBagConstraints; 27 import java.awt.GridBagLayout;28 27 import java.awt.Insets; 29 import java.util.ResourceBundle;30 28 31 29 import javax.swing.JComponent; 32 30 import javax.swing.JLabel; 33 31 34 import org.kolaka.freecast.swing.Resource Bundles;32 import org.kolaka.freecast.swing.Resources; 35 33 import org.kolaka.freecast.transport.receiver.ReceiverConfiguration; 36 34 import org.pietschy.wizard.InvalidStateException; 37 import org.pietschy.wizard.PanelWizardStep;38 import org.pietschy.wizard.WizardModel;39 35 40 public abstract class Receiver WizardStep extends PanelWizardStep {36 public abstract class ReceiverConfigurationWizardStep extends ReceiverWizardStep { 41 37 42 private final ResourceBundle bundle = ResourceBundles.getBundle(getClass()); 43 44 protected ReceiverWizardModel model; 45 46 protected ReceiverWizardStep() { 47 super("Setup Broadcast content", ""); 48 setSummary(bundle.getString("summary")); 49 setLayout(new GridBagLayout()); 38 protected ReceiverConfigurationWizardStep(Resources resources) { 39 super(resources); 50 40 51 41 GridBagConstraints textConstraints = createConstraints(); 52 42 textConstraints.gridwidth = GridBagConstraints.REMAINDER; 53 43 textConstraints.insets = new Insets(15, 0, 15, 0); 54 add(new JLabel( bundle.getString("explanation")), textConstraints);44 add(new JLabel(getBundle().getString("explanation")), textConstraints); 55 45 56 46 GridBagConstraints viewConstraints = createConstraints(); … … 61 51 } 62 52 63 protected ResourceBundle getBundle() {64 return bundle;65 }66 67 53 protected abstract JComponent createView(); 68 54 69 /**70 * @return71 */72 protected GridBagConstraints createConstraints() {73 return new GridBagConstraints();74 }75 76 public void init(WizardModel model) {77 this.model = (ReceiverWizardModel) model;78 }79 80 55 public void prepare() { 81 56 ReceiverConfiguration configuration = model.getConfiguration(); trunk/source/org/kolaka/freecast/setup/ReceiverPlaylistStep.java
r883 r912 39 39 40 40 import org.kolaka.freecast.swing.BaseAction; 41 import org.kolaka.freecast.swing.Resources; 41 42 import org.kolaka.freecast.transport.receiver.PlaylistEncoderReceiverConfiguration; 42 43 import org.kolaka.freecast.transport.receiver.ReceiverConfiguration; 43 44 import org.pietschy.wizard.InvalidStateException; 44 45 45 public class ReceiverPlaylistStep extends ReceiverWizardStep { 46 public class ReceiverPlaylistStep extends ReceiverConfigurationWizardStep { 47 48 public ReceiverPlaylistStep(Resources resources) { 49 super(resources); 50 } 46 51 47 52 private static final long serialVersionUID = -7503124420884640976L; trunk/source/org/kolaka/freecast/setup/ReceiverShoutClientStep.java
r883 r912 33 33 import javax.swing.JPanel; 34 34 35 import org.kolaka.freecast.swing.Resources; 35 36 import org.kolaka.freecast.transport.receiver.ReceiverConfiguration; 36 37 import org.kolaka.freecast.transport.receiver.ShoutClientReceiverConfiguration; 37 38 import org.pietschy.wizard.InvalidStateException; 38 39 39 public class ReceiverShoutClientStep extends ReceiverWizardStep { 40 public class ReceiverShoutClientStep extends ReceiverConfigurationWizardStep { 41 42 public ReceiverShoutClientStep(Resources resources) { 43 super(resources); 44 } 40 45 41 46 private static final long serialVersionUID = -7503124420884640976L; trunk/source/org/kolaka/freecast/setup/ReceiverShoutServerStep.java
r883 r912 35 35 import javax.swing.text.NumberFormatter; 36 36 37 import org.kolaka.freecast.swing.Resources; 37 38 import org.kolaka.freecast.transport.receiver.ReceiverConfiguration; 38 39 import org.kolaka.freecast.transport.receiver.ShoutServerReceiverConfiguration; 39 40 import org.pietschy.wizard.InvalidStateException; 40 41 41 public class ReceiverShoutServerStep extends ReceiverWizardStep { 42 public class ReceiverShoutServerStep extends ReceiverConfigurationWizardStep { 43 44 protected ReceiverShoutServerStep(Resources resources) { 45 super(resources); 46 } 42 47 43 48 private static final long serialVersionUID = -7503124420884640976L; trunk/source/org/kolaka/freecast/setup/ReceiverShowStep.java
r883 r912 24 24 package org.kolaka.freecast.setup; 25 25 26 import org.pietschy.wizard.PanelWizardStep; 27 import org.pietschy.wizard.WizardModel; 26 import org.kolaka.freecast.swing.Resources; 28 27 29 public class ReceiverShowStep extends PanelWizardStep {28 public class ReceiverShowStep extends ReceiverWizardStep { 30 29 31 30 private static final long serialVersionUID = 4158908758209666698L; 32 31 33 public ReceiverShowStep() { 34 super("Broadcast content", "Confirm the configuration"); 32 public ReceiverShowStep(Resources resources) { 33 super(resources); 34 35 35 // setLayout(new GridBagLayout()); 36 36 setComplete(true); … … 39 39 } 40 40 41 private ReceiverWizardModel model;42 41 private ReceiverShowPanel panel; 43 44 public void init(WizardModel model) {45 this.model = (ReceiverWizardModel) model;46 }47 42 48 43 public void prepare() { trunk/source/org/kolaka/freecast/setup/ReceiverTypeStep.java
r909 r912 25 25 26 26 import java.awt.GridBagConstraints; 27 import java.awt.GridBagLayout;28 27 import java.awt.Insets; 29 28 import java.awt.event.ItemEvent; 30 29 import java.awt.event.ItemListener; 31 30 import java.util.Map; 32 import java.util.ResourceBundle;33 31 import java.util.TreeMap; 34 32 … … 37 35 38 36 import org.apache.commons.logging.LogFactory; 39 import org.kolaka.freecast.swing.Resource Bundles;37 import org.kolaka.freecast.swing.Resources; 40 38 import org.pietschy.wizard.InvalidStateException; 41 import org.pietschy.wizard.PanelWizardStep;42 39 import org.pietschy.wizard.WizardModel; 43 40 44 public class ReceiverTypeStep extends PanelWizardStep {41 public class ReceiverTypeStep extends ReceiverWizardStep { 45 42 46 43 private static final long serialVersionUID = 3952637776668476330L; 47 44 48 private ResourceBundle bundle = ResourceBundles.getBundle(getClass());49 50 45 private static String[] TYPES = new String[] { 51 46 ReceiverWizardModel.TYPE_DEFAULT, ReceiverWizardModel.TYPE_PLAYLIST, … … 56 51 private Map buttons = new TreeMap(); 57 52 58 public ReceiverTypeStep() { 59 super("Setup Broadcast content",""); 60 setSummary(bundle.getString("summary")); 61 setLayout(new GridBagLayout()); 53 public ReceiverTypeStep(Resources resources) { 54 super(resources); 62 55 63 56 GridBagConstraints constraints = new GridBagConstraints(); … … 71 64 final String type = TYPES[i]; 72 65 73 final JRadioButton button = new JRadioButton( bundle.getString(type));66 final JRadioButton button = new JRadioButton(getBundle().getString(type)); 74 67 buttons.put(type, button); 75 68 button.addItemListener(new ItemListener() { trunk/source/org/kolaka/freecast/setup/ReceiverWizardModel.java
r910 r912 31 31 import org.apache.commons.collections.MapUtils; 32 32 import org.apache.commons.logging.LogFactory; 33 import org.kolaka.freecast.swing.Resources; 33 34 import org.kolaka.freecast.transport.receiver.PlaylistEncoderReceiverConfiguration; 34 35 import org.kolaka.freecast.transport.receiver.ReceiverConfiguration; … … 64 65 ) ; 65 66 66 public ReceiverWizardModel( ) {67 super(createPath( ));67 public ReceiverWizardModel(Resources resources) { 68 super(createPath(resources)); 68 69 } 69 70 70 private static Path createPath( ) {71 private static Path createPath(Resources resources) { 71 72 BranchingPath path = new BranchingPath(); 72 path.addStep(new ReceiverTypeStep( ));73 path.addStep(new ReceiverTypeStep(resources)); 73 74 74 Path finalStep = new SimplePath(new ReceiverShowStep( ));75 Path finalStep = new SimplePath(new ReceiverShowStep(resources)); 75 76 76 77 path.addBranch(finalStep, new ConfigurationClassCondition(TestReceiverConfiguration.class)); 77 78 78 SimplePath playlistPath = new SimplePath(new ReceiverPlaylistStep( ));79 SimplePath playlistPath = new SimplePath(new ReceiverPlaylistStep(resources)); 79 80 path.addBranch(playlistPath, new ConfigurationClassCondition(PlaylistEncoderReceiverConfiguration.class)); 80 81 playlistPath.setNextPath(finalStep); 81 82 82 SimplePath shoutServerPath = new SimplePath(new ReceiverShoutServerStep( ));83 SimplePath shoutServerPath = new SimplePath(new ReceiverShoutServerStep(resources)); 83 84 path.addBranch(shoutServerPath, new ConfigurationClassCondition(ShoutServerReceiverConfiguration.class)); 84 85 shoutServerPath.setNextPath(finalStep); 85 86 86 SimplePath shoutClientPath = new SimplePath(new ReceiverShoutClientStep( ));87 SimplePath shoutClientPath = new SimplePath(new ReceiverShoutClientStep(resources)); 87 88 path.addBranch(shoutClientPath, new ConfigurationClassCondition(ShoutClientReceiverConfiguration.class)); 88 89 shoutClientPath.setNextPath(finalStep); trunk/source/org/kolaka/freecast/setup/SetupAction.java
r908 r912 64 64 65 65 public void actionPerformed(ActionEvent event) { 66 final ReceiverWizardModel model = new ReceiverWizardModel( );66 final ReceiverWizardModel model = new ReceiverWizardModel(resources); 67 67 68 68 SourceReceiverConfiguration configuration = (SourceReceiverConfiguration) node.getReceiverControler().getReceiverConfiguration(); trunk/source/org/kolaka/freecast/swing/ResourcesException.java
r405 r912 27 27 * @author <a href="mailto:alban.peignier@free.fr">Alban Peignier </a> 28 28 */ 29 public class ResourcesException extends Exception {29 public class ResourcesException extends RuntimeException { 30 30 31 31 /**
