Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

26
LINES

< > BotCompany Repo | #1035634 // SSIList

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (10659L/62K).

// NotifyingList is our new go-to way to wrap a list
// with additional functions.
persistable sclass SSIList extends NotifyingList<SSI> is ByteIO {
  *() { init(); }
  *(Cl<SSI> l) { initAndAddAll(l); }
  
  public void readWrite(ByteHead head) {
    head.exchangeInt(-> size(), size -> addAll(repF(size, -> new SSI)));
    head.exchangeAll(this);
  }
  
  BufferedImage render(WidthAndHeight size) {
    ret renderAll(this, size);
  }
  
  BufferedImage render(BufferedImage canvas) {
    ret renderAll(this, canvas);
  }
  
  BufferedImage renderOutlines(WidthAndHeight size) {
    ret main render(size, g -> {
      g.setColor(Color.black);
      for (ssi : this) ssi.drawOutline(g);
    });
  }
}

download  show line numbers  debug dex  old transpilations   

Travelled to 2 computer(s): elmgxqgtpvxh, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1035634
Snippet name: SSIList
Eternal ID of this version: #1035634/12
Text MD5: a06ea515f5ae136461cda49cf61ca8e4
Transpilation MD5: 6571dbe9d178461c0a7f3a20839b668f
Author: stefan
Category: javax / imaging
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-06-27 10:02:35
Source code size: 726 bytes / 26 lines
Pitched / IR pitched: No / No
Views / Downloads: 187 / 317
Version history: 11 change(s)
Referenced in: [show references]