-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
goga
authored and
goga
committed
Jun 18, 2023
1 parent
6b755df
commit bfe0086
Showing
7 changed files
with
270 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
82 changes: 82 additions & 0 deletions
82
com.hazard157.prisex24/src/com/hazard157/prisex24/m5/frames/CommonFramesM5TreeViewer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
package com.hazard157.prisex24.m5.frames; | ||
|
||
import static com.hazard157.prisex24.m5.IPsxM5Constants.*; | ||
|
||
import org.toxsoft.core.tsgui.bricks.ctx.*; | ||
import org.toxsoft.core.tsgui.bricks.tstree.tmm.*; | ||
import org.toxsoft.core.tsgui.graphics.*; | ||
import org.toxsoft.core.tsgui.m5.*; | ||
import org.toxsoft.core.tsgui.m5.gui.viewers.*; | ||
import org.toxsoft.core.tsgui.m5.gui.viewers.impl.*; | ||
|
||
import com.hazard157.psx.common.stuff.frame.*; | ||
|
||
/** | ||
* Left list of frames. | ||
* | ||
* @author hazard157 | ||
*/ | ||
class CommonFramesM5TreeViewer | ||
extends M5TreeViewer<IFrame> { | ||
|
||
private final ITreeModeManager<IFrame> treeModeManager; | ||
|
||
public CommonFramesM5TreeViewer( ITsGuiContext aContext, IM5Model<IFrame> aObjModel ) { | ||
super( aContext, aObjModel, false ); | ||
// treeModeManager | ||
treeModeManager = new FrameCollectionPanelTmm( tsContext() ) { | ||
|
||
@Override | ||
protected void onCurrentModeIdChanged() { | ||
TreeModeInfo<IFrame> info = null; | ||
String mid = currModeId(); | ||
if( mid != null ) { | ||
info = treeModeInfoes().findByKey( mid ); | ||
} | ||
if( info != null ) { | ||
setTreeMaker( info.treeMaker() ); | ||
} | ||
else { | ||
setTreeMaker( null ); | ||
} | ||
repackColumns(); | ||
} | ||
|
||
}; | ||
} | ||
|
||
void repackColumns() { | ||
IM5Column<IFrame> col; | ||
col = columnManager().columns().getByKey( FID_FRAME_NO ); | ||
col.setWidth( 220 ); | ||
// isAnimated | ||
col = columnManager().columns().getByKey( FID_IS_ANIMATED ); | ||
col.setAlignment( EHorAlignment.CENTER ); | ||
col.pack(); | ||
// camera ID | ||
col = columnManager().columns().getByKey( FID_CAMERA_ID ); | ||
col.pack(); | ||
} | ||
|
||
@Override | ||
protected void doProcessAfterControlsCreated() { | ||
IM5Column<IFrame> col; | ||
// frameNo | ||
col = columnManager().add( FID_FRAME_NO ); | ||
// isAnimated | ||
col = columnManager().add( FID_IS_ANIMATED ); | ||
col.setAlignment( EHorAlignment.CENTER ); | ||
// camera ID | ||
col = columnManager().add( FID_CAMERA_ID ); | ||
repackColumns(); | ||
} | ||
|
||
// ------------------------------------------------------------------------------------ | ||
// API | ||
// | ||
|
||
public ITreeModeManager<IFrame> tmm() { | ||
return treeModeManager; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.