Skip to content
Snippets Groups Projects
Commit 70ec1b65 authored by Tobias Pietzsch's avatar Tobias Pietzsch
Browse files

Add ViewerOptions.numSourceGroups() to modify initial number of groups (10)

parent 45dfee2f
No related branches found
No related tags found
No related merge requests found
......@@ -137,6 +137,18 @@ public class ViewerOptions
return this;
}
/**
* Set how many source groups there are initially.
*
* @param n
* How many source groups to create initially.
*/
public ViewerOptions numSourceGroups( final int n )
{
values.numSourceGroups = n;
return this;
}
/**
* Set whether volatile versions of sources should be used if available.
*
......@@ -224,6 +236,8 @@ public class ViewerOptions
private int numRenderingThreads = 3;
private int numSourceGroups = 10;
private boolean useVolatileIfAvailable = true;
private MessageOverlayAnimator msgOverlay = new MessageOverlayAnimator( 800 );
......@@ -245,6 +259,7 @@ public class ViewerOptions
targetRenderNanos( targetRenderNanos ).
doubleBuffered( doubleBuffered ).
numRenderingThreads( numRenderingThreads ).
numSourceGroups( numSourceGroups ).
useVolatileIfAvailable( useVolatileIfAvailable ).
msgOverlay( msgOverlay ).
transformEventHandlerFactory( transformEventHandlerFactory ).
......@@ -282,6 +297,11 @@ public class ViewerOptions
return numRenderingThreads;
}
public int getNumSourceGroups()
{
return numSourceGroups;
}
public boolean isUseVolatileIfAvailable()
{
return useVolatileIfAvailable;
......
......@@ -255,7 +255,7 @@ public class ViewerPanel extends JPanel implements OverlayRenderer, TransformLis
options = optional.values;
final int numGroups = 10;
final int numGroups = options.getNumSourceGroups();
final ArrayList< SourceGroup > groups = new ArrayList<>( numGroups );
for ( int i = 0; i < numGroups; ++i )
groups.add( new SourceGroup( "group " + Integer.toString( i + 1 ) ) );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment