if (filledSlider)
if (MetalLookAndFeel.getCurrentTheme() instanceof OceanTheme) { if (slider.isEnabled()) { int yPos = yPositionForValue(slider.getValue()); int y = (slider.getInverted() ? trackY : yPos); int h = (slider.getInverted() ? yPos - trackY : trackY + trackH - yPos);  g.setColor(MetalLookAndFeel.getWhite()); g.drawLine(trackX + 1, y + 1, trackX + 1, y + h - 3); g.setColor(UIManager.getColor("Slider.altTrackColor")); g.drawLine(trackX + 2, y + 1, trackX + 2, y + h - 3); g.setColor(MetalLookAndFeel.getControlShadow()); g.drawLine(trackX + 3, y + 1, trackX + 3, y + h - 3); g.setColor(MetalLookAndFeel.getPrimaryControlShadow()); g.drawLine(trackX + 4, y + 1, trackX + 4, y + h - 3); } } else if (filledSlider)
  public void paintTrack(Graphics g)  {    Color shadowColor = MetalLookAndFeel.getControlShadow();    if (slider.getOrientation() == JSlider.HORIZONTAL)    {        int trackX = trackRect.x;        int trackY = trackRect.y + (trackRect.height - getTrackWidth()) / 2;        int trackW = trackRect.width - 1;        int trackH = getTrackWidth();                // draw border        if (slider.isEnabled())          BasicGraphicsUtils.drawEtchedRect(g, trackX, trackY, trackW, trackH,               darkShadowColor, shadowColor, darkShadowColor, highlightColor);        else          {            g.setColor(MetalLookAndFeel.getControlShadow());            g.drawRect(trackX, trackY, trackW - 2, trackH - 2);          }        // fill track (if required)      if (filledSlider)       {          int xPos = xPositionForValue(slider.getValue());          int x = (slider.getInverted() ? xPos : trackRect.x);          int w = (slider.getInverted() ? trackX + trackW - xPos                   : xPos - trackRect.x);          g.setColor(MetalLookAndFeel.getControlShadow());          g.fillRect(x + 1, trackY + 1, w - 3, getTrackWidth() - 3);          if (slider.isEnabled())            {              g.setColor(MetalLookAndFeel.getControl());              g.drawLine(x + 1, trackY + 1, x + w - 3, trackY + 1);              g.drawLine(x + 1, trackY + 1, x + 1,                       trackY + getTrackWidth() - 3);            }      }    }    else    {        int trackX = trackRect.x  + (trackRect.width - getTrackWidth()) / 2;        int trackY = trackRect.y;        int trackW = getTrackWidth();        int trackH = trackRect.height - 1;        if (slider.isEnabled())          BasicGraphicsUtils.drawEtchedRect(g, trackX, trackY, trackW, trackH,               darkShadowColor, shadowColor, darkShadowColor, highlightColor);        else          {            g.setColor(MetalLookAndFeel.getControlShadow());            g.drawRect(trackX, trackY, trackW - 2, trackH - 2);          }              if (filledSlider)       {          int yPos = yPositionForValue(slider.getValue());          int y = (slider.getInverted() ? trackY : yPos);          int h = (slider.getInverted() ? yPos - trackY                   : trackY + trackH - yPos);          g.setColor(MetalLookAndFeel.getControlShadow());          g.fillRect(trackX + 1, y + 1, getTrackWidth() - 3, h - 3);          if (slider.isEnabled())            {              g.setColor(MetalLookAndFeel.getControl());              g.drawLine(trackX + 1, y + 1, trackX + trackW - 3, y + 1);              g.drawLine(trackX + 1, y + 1, trackX + 1, y + h - 3);            }      }    }  }