X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fappletgui%2FSliderPanel.java;h=a53e9dd613151de2acd56978ceb0012f9ee6758b;hb=2bab2ead5067d824be9a7716b0fb468b38787cac;hp=caabbf98046dc6463e685327ee30c77a934a6b3d;hpb=588042b69abf8e60bcc950b24c283933c7dd422f;p=jalview.git diff --git a/src/jalview/appletgui/SliderPanel.java b/src/jalview/appletgui/SliderPanel.java index caabbf9..a53e9dd 100755 --- a/src/jalview/appletgui/SliderPanel.java +++ b/src/jalview/appletgui/SliderPanel.java @@ -25,11 +25,9 @@ import java.awt.*; import java.awt.event.*; import jalview.datamodel.*; -import jalview.jbappletgui.*; import jalview.schemes.*; -public class SliderPanel - extends GSliderPanel +public class SliderPanel extends Panel { AlignmentPanel ap; boolean forConservation = true; @@ -42,11 +40,10 @@ public class SliderPanel String source) { SliderPanel sp = null; - ConservationColourScheme ccs = (ConservationColourScheme) cs; if (conservationSlider == null) { - sp = new SliderPanel(ap, ccs.inc, true, cs); + sp = new SliderPanel(ap, cs.getConservationInc(), true, cs); conservationSlider = new Frame(); conservationSlider.add(sp); } @@ -154,6 +151,11 @@ public class SliderPanel public SliderPanel(AlignmentPanel ap, int value, boolean forConserve, ColourSchemeI cs) { + try { + jbInit(); + } catch (Exception e) { + e.printStackTrace(); + } this.ap = ap; this.cs = cs; forConservation = forConserve; @@ -217,14 +219,11 @@ public class SliderPanel if (forConservation) { - if (toChange instanceof ConservationColourScheme) - { - ( (ConservationColourScheme) toChange).inc = i; - } + toChange.setConservationInc(i); } else { - ( (ResidueColourScheme) toChange).setThreshold(i); + toChange.setThreshold(i, ap.av.getIgnoreGapsConsensus()); } groupIndex--; @@ -262,4 +261,76 @@ public class SliderPanel return Integer.parseInt(valueField.getText()); } + // this is used for conservation colours, PID colours and redundancy threshold + protected Scrollbar slider = new Scrollbar(); + protected TextField valueField = new TextField(); + protected Label label = new Label(); + Panel jPanel1 = new Panel(); + Panel jPanel2 = new Panel(); + protected Button applyButton = new Button(); + protected Button undoButton = new Button(); + FlowLayout flowLayout1 = new FlowLayout(); + protected Checkbox allGroupsCheck = new Checkbox(); + BorderLayout borderLayout1 = new BorderLayout(); + BorderLayout borderLayout2 = new BorderLayout(); + FlowLayout flowLayout2 = new FlowLayout(); + + private void jbInit() throws Exception { + this.setLayout(borderLayout2); + + // slider.setMajorTickSpacing(10); + // slider.setMinorTickSpacing(1); + // slider.setPaintTicks(true); + slider.setBackground(Color.white); + slider.setFont(new java.awt.Font("Verdana", 0, 11)); + slider.setOrientation(0); + valueField.setFont(new java.awt.Font("Verdana", 0, 11)); + valueField.setText(" "); + valueField.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(ActionEvent e) { + valueField_actionPerformed(e); + } + }); + label.setFont(new java.awt.Font("Verdana", 0, 11)); + label.setText("set this label text"); + jPanel1.setLayout(borderLayout1); + jPanel2.setLayout(flowLayout1); + applyButton.setFont(new java.awt.Font("Verdana", 0, 11)); + applyButton.setLabel("Apply"); + applyButton.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(ActionEvent e) { + applyButton_actionPerformed(e); + } + }); + undoButton.setEnabled(false); + undoButton.setFont(new java.awt.Font("Verdana", 0, 11)); + undoButton.setLabel("Undo"); + undoButton.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(ActionEvent e) { + undoButton_actionPerformed(e); + } + }); + allGroupsCheck.setEnabled(false); + allGroupsCheck.setFont(new java.awt.Font("Verdana", 0, 11)); + allGroupsCheck.setLabel("Apply threshold to all groups"); + allGroupsCheck.setName("Apply to all Groups"); + this.setBackground(Color.white); + this.setForeground(Color.black); + jPanel2.add(label, null); + jPanel2.add(applyButton, null); + jPanel2.add(undoButton, null); + jPanel2.add(allGroupsCheck); + jPanel1.add(valueField, java.awt.BorderLayout.EAST); + jPanel1.add(slider, java.awt.BorderLayout.CENTER); + this.add(jPanel1, java.awt.BorderLayout.SOUTH); + this.add(jPanel2, java.awt.BorderLayout.CENTER); + } + + protected void applyButton_actionPerformed(ActionEvent e) + { + } + + protected void undoButton_actionPerformed(ActionEvent e) + { + } }