4.9. IBezelCommandBuilder

added in version 1.14.0

An interface to provide functions to generate commands for the bezel control.

  • Constant

    Name

    Contents

    Mode

    Bezel mode constants

    AutomaticPageLengthType

    Automatic page length constants

  • Method

    Name

    Contents

    appendBezelMode

    A command to set the bezel mode is generated and added to the command buffer.

    appendAutomaticPageLength

    A command to set the automatic page length is generated and added to the command buffer.

    getCommands

    Gets the command buffer (generated command).

This interface is only for models with bezel. This table shows the supported methods for each model.

Model/Emulation

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

appendBezelMode

appendAutomaticPageLength

getCommands

4.9.1. Mode

added in version 1.14.0

Bezel mode constants

  • Declaration

    enum Mode {
        Invalid,
        Valid,
        Default
    }
    
  • Value

    Name

    Contents

    Invalid

    Invalid

    Valid

    Valid

    Default

    Follow the memory switch setting

4.9.2. AutomaticPageLengthType

added in version 1.14.0

Automatic page length constants

  • Declaration

    enum AutomaticPageLengthType {
        Invalid,
        Valid,
        Default
    }
    
  • Value

    Name

    Contents

    Invalid

    Invalid

    Valid

    Valid

    Default

    Follow the memory switch setting

4.9.3. appendBezelMode

added in version 1.14.0

A command to set the bezel mode is generated and added to the command buffer.

  • Declaration

    void appendBezelMode(Mode mode);
    
  • Parameter

    Name

    Contents

    Type

    mode

    Bezel mode constants

    Mode

  • Return value

    None

  • Examples

    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;
    }
    

    Refer to ApiFragment.java.

4.9.4. appendAutomaticPageLength

added in version 1.14.0

A command to set the automatic page length is generated and added to the command buffer.

  • Declaration

    void appendAutomaticPageLength(AutomaticPageLengthType type);
    
  • Parameter

    Name

    Contents

    Type

    type

    Automatic page length constants

    AutomaticPageLengthType

  • Return value

    None

  • Examples

    Refer to the example of the :ref:`IBezelCommandBuilder_appendBezelMode` method.

4.9.5. getCommands

added in version 1.14.0

Gets the command buffer (generated command).

  • Declaration

    byte[] getCommands();
    
  • Parameter

    None

  • Return value

    Contents

    Type

    Command buffer (generated command)

    byte[]