public abstract class AbstractContinuousLayout extends Object
Modifier and Type | Field and Description |
---|---|
protected Rectangle |
aggregateBounds |
protected int |
currentPageIndexCache |
protected EventList<Page> |
pageList |
protected ArrayList<com.levigo.jadice.swing.pageview.RenderedPage> |
renderedPages |
protected AtomicBoolean |
renderingValid |
protected PageView |
view |
Constructor and Description |
---|
AbstractContinuousLayout(PageView view) |
Modifier and Type | Method and Description |
---|---|
boolean |
canHandle(Document document)
Verify whether this PageLayout is prepared to deal with the given document.
|
protected abstract void |
doLayout()
This method must be implemented in order to provide the actual layout functionality.
|
abstract com.levigo.jadice.swing.pageview.RenderedPage |
findPageNextTo(Point p)
Find the page closest to the given point.
|
int |
getAdjacentNavigationIndex(Rectangle visibleRect,
Position.Bias bias)
By default, we assume a navigation increment of one.
|
Rectangle |
getAggregateBounds() |
int |
getCurrentPageIndex(Rectangle visibleRect) |
com.levigo.jadice.swing.pageview.RenderedPage |
getCurrentRenderedPage(Rectangle visibleRect) |
Dimension |
getPreferredSize(Dimension viewportSize)
Return the preferred size occupied by the laid-out pages based on the given viewport size.
|
com.levigo.jadice.swing.pageview.RenderedPage |
getRenderedPage(Page p) |
List<com.levigo.jadice.swing.pageview.RenderedPage> |
getRenderedPages() |
void |
invalidate()
Invalidate the layout.
|
void |
listChanged(ListEvent<Page> listChanges)
When the underlying list changes, this notification allows the object to repaint itself or
update itself as necessary.
|
protected void |
revalidateView()
Synchronously invalidate then validate the view size, so that the view size is updated
immediately.
|
void |
setCurrentPageIndex(int index) |
void |
setPageList(EventList<Page> pageList)
Set the current document.
|
void |
validate()
Validate the layout.
|
protected int currentPageIndexCache
protected final ArrayList<com.levigo.jadice.swing.pageview.RenderedPage> renderedPages
protected final Rectangle aggregateBounds
protected final AtomicBoolean renderingValid
protected final PageView view
public AbstractContinuousLayout(PageView view)
public void setCurrentPageIndex(int index)
public List<com.levigo.jadice.swing.pageview.RenderedPage> getRenderedPages()
public Rectangle getAggregateBounds()
public int getCurrentPageIndex(Rectangle visibleRect)
public void listChanged(ListEvent<Page> listChanges)
ListEventListener
It is mandatory that the calling thread has obtained the write lock on the source list. This is because the calling thread will have written to the source list to cause this event. This condition guarantees that no writes can occur while the listener is handling this event. It is an error to write to the source list while processing an event.
listChanges
- a ListEvent
describing the changes to the listpublic com.levigo.jadice.swing.pageview.RenderedPage getCurrentRenderedPage(Rectangle visibleRect)
public com.levigo.jadice.swing.pageview.RenderedPage getRenderedPage(Page p)
public boolean canHandle(Document document)
public void validate()
public void invalidate()
protected abstract void doLayout()
public abstract com.levigo.jadice.swing.pageview.RenderedPage findPageNextTo(Point p)
null
if there is no page at all.public int getAdjacentNavigationIndex(Rectangle visibleRect, Position.Bias bias)
visibleRect
- the visible regionbias
- the direction for which to return the next index. See Position.Bias.Forward
,
Position.Bias.Backward
.PageLayout.getAdjacentNavigationIndex(java.awt.Rectangle,
javax.swing.text.Position.Bias)
protected void revalidateView()
Copyright © 2024 levigo holding gmbh. All rights reserved.