2021-07-15 18:37:03 -04:00
|
|
|
|
|
|
|
import javax.swing.JFrame;
|
|
|
|
import javax.swing.JPanel;
|
2021-07-15 19:07:23 -04:00
|
|
|
import javax.swing.JComponent;
|
2021-07-15 18:37:03 -04:00
|
|
|
import java.awt.Dimension;
|
2021-07-15 19:07:23 -04:00
|
|
|
import java.awt.BorderLayout;
|
2021-07-15 18:37:03 -04:00
|
|
|
|
|
|
|
class
|
2021-07-15 19:07:23 -04:00
|
|
|
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);
|
2021-07-29 04:03:32 -04:00
|
|
|
//new ComposeWindow().setVisible(true);
|
2021-07-31 07:28:46 -04:00
|
|
|
new PostWindow().setVisible(true);
|
2021-07-15 19:07:23 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
// - -%- -
|
|
|
|
|
|
|
|
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
|
|
|
}
|