SettingsManager.set ( "NinePatchEditor", "areaCursor", ac );
ninePatchEditor.setShowAreaCursorPosition ( ac );
}
} );
final WebSlider zoomSlider = new WebSlider ( NinePatchEditor.MIN_ZOOM, NinePatchEditor.MAX_ZOOM, ninePatchEditor.getZoom () );
zoomSlider.setPreferredWidth ( 170 );
zoomSlider.setAngledThumb ( false );
zoomSlider.setPaintTicks ( false );
zoomSlider.setPaintLabels ( false );
changeListener = new ChangeListener ()
{
@Override
public void stateChanged ( final ChangeEvent e )
{
ninePatchEditor.removeZoomChangeListener ( zoomChangeListener );
ninePatchEditor.setZoom ( zoomSlider.getValue () );
ninePatchEditor.addZoomChangeListener ( zoomChangeListener );
}
};
zoomSlider.addChangeListener ( changeListener );
zoomChangeListener = new ZoomChangeListener ()
{
@Override
public void zoomChanged ()
{
zoomSlider.removeChangeListener ( changeListener );
zoomSlider.setValue ( ninePatchEditor.getZoom () );
zoomSlider.addChangeListener ( changeListener );
}
};
ninePatchEditor.addZoomChangeListener ( zoomChangeListener );
final WebButton minZoom = new WebButton ( MIN_ICON );
minZoom.setRolloverDecoratedOnly ( true );
minZoom.addActionListener ( new ActionListener ()
{
@Override
public void actionPerformed ( final ActionEvent e )
{
zoomSlider.setValue ( NinePatchEditor.MIN_ZOOM );
}
} );
final WebButton maxZoom = new WebButton ( MAX_ICON );
maxZoom.setRolloverDecoratedOnly ( true );
maxZoom.addActionListener ( new ActionListener ()
{
@Override
public void actionPerformed ( final ActionEvent e )
{
zoomSlider.setValue ( NinePatchEditor.MAX_ZOOM );
}
} );
bottomToolBar.add ( showGuidesSpacing );
bottomToolBar.add ( showRuler );