< prev index next > modules/javafx.graphics/src/main/java/com/sun/javafx/text/PrismTextLayout.java
Print this page
/*
! * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
/*
! * Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
private float layoutWidth, layoutHeight;
private float wrapWidth, spacing;
private LayoutCache layoutCache;
private Shape shape;
private int flags;
+ private int tabSize = DEFAULT_TAB_SIZE;
public PrismTextLayout() {
logicalBounds = new RectBounds();
flags = ALIGN_LEFT;
}
shape = outline;
}
return outline;
}
+ @Override
+ public boolean setTabSize(int spaces) {
+ if (spaces < 1)
+ spaces = 1;
+ if (tabSize != spaces) {
+ tabSize = spaces;
+ relayout();
+ return true;
+ }
+ return false;
+ }
+
/***************************************************************************
* *
* Text Layout Implementation *
* *
**************************************************************************/
}
}
} else {
spaceAdvance = strike.getCharAdvance(' ');
}
! return 8 * spaceAdvance;
}
private void layout() {
/* Try the cache */
initCache();
}
}
} else {
spaceAdvance = strike.getCharAdvance(' ');
}
! return tabSize * spaceAdvance;
}
private void layout() {
/* Try the cache */
initCache();
< prev index next >