4.9. IBezelCommandBuilder

added in version 1.14.0

ベゼル制御用コマンドを生成する機能を提供するインターフェイスです。

  • 列挙型

    名称

    説明

    Mode

    ベゼルモード指定定数

    AutomaticPageLengthType

    自動ページ長タイプ指定定数

  • メソッド

    名称

    説明

    appendBezelMode

    ベゼルモード設定コマンドを生成し、コマンドバッファに追加します。

    appendAutomaticPageLength

    自動ページ長設定コマンドを生成し、コマンドバッファに追加します。

    getCommands

    コマンドバッファ(生成したコマンド)を取得します。

本インターフェイスはベゼル付きモデル専用です。 各モデルにおいて機能するメソッドは以下のとおりです。

モデル/エミュレーション

SK1-211/221/V211 SK1-311/321/V311
StarPRNT StarPRNT

appendBezelMode

appendAutomaticPageLength

getCommands

4.9.1. Mode

added in version 1.14.0

ベゼルモード指定定数

  • 宣言

    enum Mode {
        Invalid,
        Valid,
        Default
    }
    
  • 名称

    説明

    Invalid

    ベゼル無効

    Valid

    ベゼル有効

    Default

    メモリスイッチ設定に従う

4.9.2. AutomaticPageLengthType

added in version 1.14.0

自動ページ長タイプ指定定数

  • 宣言

    enum AutomaticPageLengthType {
        Invalid,
        Valid,
        Default
    }
    
  • 名称

    説明

    Invalid

    自動ページ長無効

    Valid

    自動ページ長有効

    Default

    メモリスイッチ設定に従う

4.9.3. appendBezelMode

added in version 1.14.0

ベゼルモード設定コマンドを生成し、コマンドバッファに追加します。

  • 宣言

    void appendBezelMode(Mode mode);
    
  • 引数

    名称

    説明

    mode

    ベゼルモード指定定数

    Mode

  • 戻り値

    なし

  • 実装例

    public static byte[] createBezelAutomaticPageLengthData(Emulation emulation, AutomaticPageLengthType type) {
        IBezelCommandBuilder bezelCommandBuilder = StarIoExt.createBezelCommandBuilder(emulation);
        bezelCommandBuilder.appendBezelMode(Mode.Valid);
        bezelCommandBuilder.appendAutomaticPageLength(type);
    
        ICommandBuilder printerCommandBuilder = StarIoExt.createCommandBuilder(emulation);
        printerCommandBuilder.beginDocument();
        printerCommandBuilder.append("Hello world".getBytes());
        printerCommandBuilder.appendCutPaper(CutPaperAction.PartialCutWithFeed);
        printerCommandBuilder.endDocument();
    
        byte[] commands = new byte[bezelCommandBuilder.getCommands().length + printerCommandBuilder.getCommands().length];
        System.arraycopy(bezelCommandBuilder.getCommands(), 0, commands, 0, bezelCommandBuilder.getCommands().length);
        System.arraycopy(printerCommandBuilder.getCommands(), 0, commands, bezelCommandBuilder.getCommands().length, printerCommandBuilder.getCommands().length);
    
        return commands;
    }
    

    ApiFunctions.javaを参照ください。

4.9.4. appendAutomaticPageLength

added in version 1.14.0

自動ページ長設定コマンドを生成し、コマンドバッファに追加します。

  • 宣言

    void appendAutomaticPageLength(AutomaticPageLengthType type);
    
  • 引数

    名称

    説明

    type

    自動ページ長タイプ指定定数

    AutomaticPageLengthType

  • 戻り値

    なし

  • 実装例

    appendBezelMode メソッドの実装例を参照ください。

4.9.5. getCommands

added in version 1.14.0

コマンドバッファ(生成したコマンド)を取得します。

  • 宣言

    byte[] getCommands();
    
  • 引数

    なし

  • 戻り値

    説明

    コマンドバッファ(生成したコマンド)

    byte[]