biskuteri-cafe-JKomasto2/JKomasto.java

118 lines
1.5 KiB
Java
Raw Normal View History

2021-07-15 18:37:03 -04:00
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JComponent;
2021-07-15 18:37:03 -04:00
import java.awt.Dimension;
import java.awt.BorderLayout;
2021-07-15 18:37:03 -04:00
class
JKomasto {
2021-07-15 18:37:03 -04:00
public static void
2021-07-16 05:46:17 -04:00
main(String... args) { new JKomasto(); }
2021-07-15 18:37:03 -04:00
// ---%-@-%---
2021-07-17 05:37:00 -04:00
public
2021-07-15 18:37:03 -04:00
JKomasto()
{
2021-07-31 07:28:46 -04:00
//new TimelineWindow().setVisible(true);
//new ComposeWindow().setVisible(true);
2021-07-31 07:28:46 -04:00
new PostWindow().setVisible(true);
}
// - -%- -
private static void
test(JComponent component, int width, int height)
{
JFrame frame = new JFrame();
frame.setTitle(component.getClass().getName());
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
frame.setLocationByPlatform(true);
JPanel panel = new JPanel();
panel.setPreferredSize(new Dimension(width, height));
panel.add(component);
frame.setContentPane(panel);
frame.setVisible(true);
2021-07-15 18:37:03 -04:00
}
}
2021-07-16 05:46:17 -04:00
2021-07-17 07:17:14 -04:00
enum
PostVisibility {
PUBLIC,
LOCAL,
FOLLOWERS,
MENTIONED
}
enum
TimelineType {
FEDERATED,
LOCAL,
HOME,
MENTIONS,
MESSAGES,
LIST
}
2021-07-16 05:46:17 -04:00
class
Timeline {
2021-07-17 07:17:14 -04:00
public TimelineType
type;
2021-07-16 05:46:17 -04:00
}
class
Post {
2021-07-17 07:17:14 -04:00
public String
text;
public String
authorId, authorName;
public String
date;
public PostVisibility
visibility;
public String
postId;
public boolean
boosted, favourited;
2021-07-16 05:46:17 -04:00
}
class
Composition {
2021-07-17 07:17:14 -04:00
public String
text;
public PostVisibility
visibility;
public String
replyToPostId;
2021-07-16 05:46:17 -04:00
}