Class JTextComponentScaler
java.lang.Object
org.vanted.scaling.scalers.BasicScaler
org.vanted.scaling.scalers.component.ComponentScaler
org.vanted.scaling.scalers.component.JTextComponentScaler
- All Implemented Interfaces:
HTMLScaler
,Scaler
public class JTextComponentScaler extends ComponentScaler implements HTMLScaler
A JTextComponent-specific extension of
ComponentScaler
.- Author:
- D. Garkov
-
Constructor Summary
Constructors Constructor Description JTextComponentScaler(float scaleFactor)
-
Method Summary
Modifier and Type Method Description static void
alignJEP(JTextComponent text)
JEditorPane has a couple of intrinsic properties, with the help of which, one could control to a certain extent, the layout (e.g.void
coscaleFont(JComponent component)
Scales all components that have their font not modified by the LAF-Scalers for one reason or another up to this point.void
coscaleHTML(JComponent component)
Interface method formodifyHTML(String, JTextComponent)
.void
scaleComponent(JComponent immediateComponent)
A method to be called when this JTextComponentScaler has been dispatched to some immediate Component to be scaled.Methods inherited from class org.vanted.scaling.scalers.component.ComponentScaler
coscaleIcon, coscaleInsets
Methods inherited from class org.vanted.scaling.scalers.BasicScaler
getScaleFactor, initialScaling, modifyFont, modifyIcon, modifyInsets, modifyInteger, setScaleFactor
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.vanted.scaling.scalers.Scaler
initialScaling, modifyFont, modifyIcon, modifyInsets, modifyInteger
-
Constructor Details
-
JTextComponentScaler
public JTextComponentScaler(float scaleFactor)
-
-
Method Details
-
scaleComponent
A method to be called when this JTextComponentScaler has been dispatched to some immediate Component to be scaled. This tackles the problem that after a complete application scaling, through the ScalingSlider, further components, initialized posterior, are not scaled. In order to do so, attach a scaler and call this method upon initialization.- Overrides:
scaleComponent
in classComponentScaler
- Parameters:
immediateComponent
- to be scaled
-
coscaleFont
Description copied from class:ComponentScaler
Scales all components that have their font not modified by the LAF-Scalers for one reason or another up to this point.- Overrides:
coscaleFont
in classComponentScaler
- Parameters:
component
- the JComponent, whose Font is to be scaled
-
coscaleHTML
Interface method formodifyHTML(String, JTextComponent)
. Part of the HTML-supporting interface contract.Be careful to update the font too, because this is taken as basis and thus the end HTML scaling depends on it.
- Specified by:
coscaleHTML
in interfaceHTMLScaler
- Parameters:
component
-
-
alignJEP
JEditorPane has a couple of intrinsic properties, with the help of which, one could control to a certain extent, the layout (e.g. HTML) globally. These areJEditorPane.HONOR_DISPLAY_PROPERTIES
andJEditorPane.W3C_LENGTH_UNITS
.- Parameters:
text
- JComponent to be checked, only JEditorPanes possess the system property to be set.
-