📄 cblksizespec.java
字号:
} if ( dim[1].intValue() > maxCBlkHeight ) { maxCBlkHeight = dim[1].intValue(); } if ( firstVal ) { // This is the first time a value is given so we set it as // the default one setDefault(dim); firstVal = false; } switch (curSpecType) { case SPEC_DEF: setDefault(dim); break; case SPEC_TILE_DEF: for(ti=tileSpec.length-1; ti>=0; ti--) { if( tileSpec[ti] ){ setTileDef(ti,dim); } } break; case SPEC_COMP_DEF: for(ci=compSpec.length-1; ci>=0; ci--) { if( compSpec[ci] ){ setCompDef(ci,dim); } } break; default: for(ti=tileSpec.length-1; ti>=0; ti--){ for(ci=compSpec.length-1; ci>=0 ; ci--){ if(tileSpec[ti] && compSpec[ci]){ setTileCompVal(ti,ci,dim); } } } break; } } // end switch } } /** * Returns the maximum code-block's width * */ public int getMaxCBlkWidth() { return maxCBlkWidth; } /** * Returns the maximum code-block's height * */ public int getMaxCBlkHeight() { return maxCBlkHeight; } /** * Returns the code-block width : * * <ul> * <li>for the specified tile/component</li> * <li>for the specified tile</li> * <li>for the specified component</li> * <li>default value</li> * </ul> * * The value returned depends on the value of the variable 'type' which * can take the following values :<br> * * <ul> * <li>SPEC_DEF -> Default value is returned. t and c values are * ignored</li> * <li>SPEC_COMP_DEF -> Component default value is returned. t value is * ignored</li> * <li>SPEC_TILE_DEF -> Tile default value is returned. c value is * ignored</li> * <li>SPEC_TILE_COMP -> Tile/Component value is returned.</li> * </ul> * * @param type The type of the value we want to be returned * * @param t The tile index * * @param c the component index * * @return The code-block width for the specified tile and component * */ public int getCBlkWidth(byte type, int t, int c) { Integer dim[] = null; switch (type) { case SPEC_DEF: dim = (Integer[])getDefault(); break; case SPEC_COMP_DEF: dim = (Integer[])getCompDef(c); break; case SPEC_TILE_DEF: dim = (Integer[])getTileDef(t); break; case SPEC_TILE_COMP: dim = (Integer[])getTileCompVal(t, c); } return dim[0].intValue(); } /** * Returns the code-block height: * * <ul> * <li>for the specified tile/component</li> * <li>for the specified tile</li> * <li>for the specified component</li> * <li>default value</li> * </ul> * * The value returned depends on the value of the variable 'type' which * can take the following values : * * <ul> * <li>SPEC_DEF -> Default value is returned. t and c values are * ignored</li> * <li>SPEC_COMP_DEF -> Component default value is returned. t value is * ignored</li> * <li>SPEC_TILE_DEF -> Tile default value is returned. c value is * ignored</li> * <li>SPEC_TILE_COMP -> Tile/Component value is returned.</li> * </ul> * * @param type The type of the value we want to be returned * * @param t The tile index * * @param c the component index * * @return The code-block height for the specified tile and component * */ public int getCBlkHeight(byte type, int t, int c) { Integer dim[] = null; switch (type) { case SPEC_DEF: dim = (Integer[])getDefault(); break; case SPEC_COMP_DEF: dim = (Integer[])getCompDef(c); break; case SPEC_TILE_DEF: dim = (Integer[])getTileDef(t); break; case SPEC_TILE_COMP: dim = (Integer[])getTileCompVal(t, c); } return dim[1].intValue(); } /** * Sets default value for this module * * @param value Default value * */ public void setDefault(Object value){ super.setDefault(value); // Store the biggest code-block dimensions storeHighestDims((Integer[])value); } /** * Sets default value for specified tile and specValType tag if allowed by * its priority. * * @param c Tile index. * * @param value Tile's default value * */ public void setTileDef(int t, Object value){ super.setTileDef(t, value); // Store the biggest code-block dimensions storeHighestDims((Integer[])value); } /** * Sets default value for specified component and specValType tag if * allowed by its priority. * * @param c Component index * * @param value Component's default value * */ public void setCompDef(int c, Object value){ super.setCompDef(c, value); // Store the biggest code-block dimensions storeHighestDims((Integer[])value); } /** * Sets value for specified tile-component. * * @param t Tie index * * @param c Component index * * @param value Tile-component's value * */ public void setTileCompVal(int t,int c, Object value){ super.setTileCompVal(t, c, value); // Store the biggest code-block dimensions storeHighestDims((Integer[])value); } /** * Stores the highest code-block width and height * * @param dim The 2 elements array that contains the code-block width and * height. * */ private void storeHighestDims(Integer[] dim){ // Store the biggest code-block dimensions if ( dim[0].intValue() > maxCBlkWidth ) { maxCBlkWidth = dim[0].intValue(); } if ( dim[1].intValue() > maxCBlkHeight ) { maxCBlkHeight = dim[1].intValue(); } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -